neo: do not instantiatetypes directly, use the model API
authorJean Privat <jean@pryen.org>
Wed, 1 Oct 2014 00:01:25 +0000 (20:01 -0400)
committerJean Privat <jean@pryen.org>
Wed, 1 Oct 2014 00:01:25 +0000 (20:01 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/neo.nit

index 8da9966..b44d034 100644 (file)
@@ -742,12 +742,13 @@ class NeoModel
                        return  mtype
                else if node.labels.has("MNullableType") then
                        var intype = to_mtype(model, node.out_nodes("TYPE").first)
-                       var mtype = new MNullableType(intype)
+                       var mtype = intype.as_nullable
                        mentities[node] = mtype
                        return mtype
                else if node.labels.has("MVirtualType") then
                        var mproperty = to_mproperty(model, node.out_nodes("PROPERTY").first)
-                       var mtype = new MVirtualType(mproperty)
+                       assert mproperty isa MVirtualTypeProp
+                       var mtype = mproperty.mvirtualtype
                        mentities[node] = mtype
                        return mtype
                else if node.labels.has("MSignature") then