engines: no more `super_inits` method used in old-style automatic init
[nit.git] / src / transform.nit
index 6bd37b0..6a209c3 100644 (file)
@@ -17,8 +17,8 @@
 module transform
 
 import astbuilder
-import auto_super_init
 import astvalidation
+import semantize
 
 redef class ToolContext
        var transform_phase: Phase = new TransformPhase(self, [typing_phase, auto_super_init_phase])
@@ -191,6 +191,7 @@ redef class ACrangeExpr
        # `[x..y]` is replaced with `new Range[X](x,y)`
        redef fun accept_transform_visitor(v)
        do
+               if parent isa AForExpr then return # to permit shortcut ranges
                replace_with(v.builder.make_new(init_callsite.as(not null), [n_expr, n_expr2]))
        end
 end
@@ -199,6 +200,7 @@ redef class AOrangeExpr
        # `[x..y[` is replaced with `new Range[X].without_last(x,y)`
        redef fun accept_transform_visitor(v)
        do
+               if parent isa AForExpr then return # to permit shortcut ranges
                replace_with(v.builder.make_new(init_callsite.as(not null), [n_expr, n_expr2]))
        end
 end
@@ -226,7 +228,7 @@ redef class ASendReassignFormExpr
 
                var read_args = new Array[AExpr]
                var write_args = new Array[AExpr]
-               for a in raw_arguments.as(not null) do
+               for a in raw_arguments do
                        nblock.add(a)
                        read_args.add(a.make_var_read)
                        write_args.add(a.make_var_read)