(TypeEnv tenv)
| 105 | @Reviser public static class IfEx extends IfStmnt { |
| 106 | public IfEx(List<ASTree> c) { super(c); } |
| 107 | public TypeInfo typeCheck(TypeEnv tenv) throws TypeException { |
| 108 | TypeInfo condType = ((ASTreeTypeEx)condition()).typeCheck(tenv); |
| 109 | condType.assertSubtypeOf(TypeInfo.INT, tenv, this); |
| 110 | TypeInfo thenType = ((ASTreeTypeEx)thenBlock()).typeCheck(tenv); |
| 111 | TypeInfo elseType; |
| 112 | ASTree elseBk = elseBlock(); |
| 113 | if (elseBk == null) |
| 114 | elseType = TypeInfo.INT; |
| 115 | else |
| 116 | elseType = ((ASTreeTypeEx)elseBk).typeCheck(tenv); |
| 117 | return thenType.union(elseType, tenv); |
| 118 | } |
| 119 | } |
| 120 | @Reviser public static class WhileEx extends WhileStmnt { |
| 121 | public WhileEx(List<ASTree> c) { super(c); } |
no test coverage detected