(Expr.Cast expr, Typing typing, Environment environment)
| 2163 | } |
| 2164 | |
| 2165 | private Typing pullCast(Expr.Cast expr, Typing typing, Environment environment) { |
| 2166 | // >>> Propagate forwards into children |
| 2167 | typing = pullExpression(expr.getOperand(), true, typing, environment); |
| 2168 | int src = typing.top(); |
| 2169 | // Check cast makes sense |
| 2170 | Typing nTyping = typing.filter(r -> isSensibleCast(expr.getType(), r.get(src), environment)); |
| 2171 | // Report errors |
| 2172 | checkForError(expr.getOperand(), typing, nTyping, expr.getType(), src); |
| 2173 | // <<< Propagate backwards into parent |
| 2174 | return nTyping.map(row -> row.add(expr.getType())); |
| 2175 | } |
| 2176 | |
| 2177 | private Typing pullConditionExpression(Expr expr, Typing typing, Environment environment) { |
| 2178 | // Check condition |
no test coverage detected