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

Method typeCheck

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

Source from the content-addressed store, hash-verified

203 protected TypeInfo varType, valueType;
204 public VarStmntEx2(List<ASTree> c) { super(c); }
205 public TypeInfo typeCheck(TypeEnv tenv) throws TypeException {
206 if (tenv.get(0, index) != null)
207 throw new TypeException("duplicate variable: " + name(), this);
208 varType = TypeInfo.get(type());
209 tenv.put(0, index, varType);
210 valueType = ((ASTreeTypeEx)initializer()).typeCheck(tenv);
211 valueType.assertSubtypeOf(varType, tenv, this);
212 return varType;
213 }
214 }
215}

Callers

nothing calls this directly

Calls 8

getMethod · 0.95
initializerMethod · 0.80
getMethod · 0.65
putMethod · 0.65
nameMethod · 0.45
typeMethod · 0.45
typeCheckMethod · 0.45
assertSubtypeOfMethod · 0.45

Tested by

no test coverage detected