(TypeEnv tenv, TypeInfo target)
| 182 | protected TypeInfo.FunctionType funcType; |
| 183 | public ArgumentsEx(List<ASTree> c) { super(c); } |
| 184 | public TypeInfo typeCheck(TypeEnv tenv, TypeInfo target) |
| 185 | throws TypeException |
| 186 | { |
| 187 | if (!(target instanceof TypeInfo.FunctionType)) |
| 188 | throw new TypeException("bad function", this); |
| 189 | funcType = (TypeInfo.FunctionType)target; |
| 190 | TypeInfo[] params = funcType.parameterTypes; |
| 191 | if (size() != params.length) |
| 192 | throw new TypeException("bad number of arguments", this); |
| 193 | argTypes = new TypeInfo[params.length]; |
| 194 | int num = 0; |
| 195 | for (ASTree a: this) { |
| 196 | TypeInfo t = argTypes[num] = ((ASTreeTypeEx)a).typeCheck(tenv); |
| 197 | t.assertSubtypeOf(params[num++], tenv, this); |
| 198 | } |
| 199 | return funcType.returnType; |
| 200 | } |
| 201 | } |
| 202 | @Reviser public static class VarStmntEx2 extends TypedEvaluator.VarStmntEx { |
| 203 | protected TypeInfo varType, valueType; |
nothing calls this directly
no test coverage detected