compiler: Accepts `new` constructor on non pointer-based class (eg. NativeString)
authorJean Privat <jean@pryen.org>
Thu, 12 Jun 2014 14:16:57 +0000 (10:16 -0400)
committerJean Privat <jean@pryen.org>
Thu, 12 Jun 2014 14:16:57 +0000 (10:16 -0400)
Just use with a placebo receiver like in other cases.

Signed-off-by: Jean Privat <jean@pryen.org>

src/abstract_compiler.nit

index 8faa8c5..a453f6b 100644 (file)
@@ -2621,8 +2621,7 @@ redef class ANewExpr
                else if ctype == "void*" then
                        recv = v.new_expr("NULL/*special!*/", mtype)
                else
-                       debug("cannot new {mtype}")
-                       abort
+                       recv = v.new_expr("({ctype})0/*special!*/", mtype)
                end
                var args = [recv]
                for a in self.n_args.n_exprs do