redef class ABlockExpr
redef fun accept_typing(v)
do
- var old_var_ctx = v.variable_ctx
- v.variable_ctx = v.variable_ctx.sub(self)
-
for e in n_expr do
if not v.variable_ctx.unreash then
v.enter_visit(e)
end
end
- v.variable_ctx = old_var_ctx.merge_reash(self, v.variable_ctx, v.variable_ctx, v.base_variable_ctx)
_is_typed = true
end
end
v.escapable_ctx.push(escapable, n_label)
var old_var_ctx = v.variable_ctx
+ v.variable_ctx = old_var_ctx.sub(self)
super
# Add the end of the block as an exit context
private fun get_property(v: TypingVisitor, type_recv: MMType, is_implicit_self: Bool, name: Symbol): nullable MMMethod
do
if type_recv isa MMTypeNone then
- v.error(self, "Error: Method '{name}' call on 'null'.")
- return null
+ if name == (once "==".to_symbol) or name == (once "!=".to_symbol) then
+ # Special case on != and == that are allowed for 'null'
+ type_recv = v.type_object.as_nullable
+ else
+ v.error(self, "Error: Method '{name}' call on 'null'.")
+ return null
+ end
end
var lc = type_recv.local_class
var prop: nullable MMMethod = null