MCPcopy Create free account
hub / github.com/chibash/stone / typeCheck

Method typeCheck

src/chap14/TypeChecker.java:122–127  ·  view source on GitHub ↗
(TypeEnv tenv)

Source from the content-addressed store, hash-verified

120 @Reviser public static class WhileEx extends WhileStmnt {
121 public WhileEx(List<ASTree> c) { super(c); }
122 public TypeInfo typeCheck(TypeEnv tenv) throws TypeException {
123 TypeInfo condType = ((ASTreeTypeEx)condition()).typeCheck(tenv);
124 condType.assertSubtypeOf(TypeInfo.INT, tenv, this);
125 TypeInfo bodyType = ((ASTreeTypeEx)body()).typeCheck(tenv);
126 return bodyType.union(TypeInfo.INT, tenv);
127 }
128 }
129 @Reviser public static class DefStmntEx2 extends TypedEvaluator.DefStmntEx {
130 protected TypeInfo.FunctionType funcType;

Callers

nothing calls this directly

Calls 5

assertSubtypeOfMethod · 0.95
unionMethod · 0.95
typeCheckMethod · 0.45
conditionMethod · 0.45
bodyMethod · 0.45

Tested by

no test coverage detected