modelize_property: Promote `refine-type` to an error
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Thu, 18 Aug 2016 15:50:27 +0000 (11:50 -0400)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Thu, 18 Aug 2016 15:50:27 +0000 (11:50 -0400)
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

src/modelize/modelize_property.nit
tests/base_virtual_type4.nit
tests/sav/base_virtual_type4.res
tests/sav/base_virtual_type4_alt1.res [deleted file]

index 5ba3196..d0059fe 100644 (file)
@@ -1686,8 +1686,7 @@ redef class ATypePropdef
                                break
                        end
                        if p.mclassdef.mclass == mclassdef.mclass then
-                               # Still a warning to pass existing bad code
-                               modelbuilder.warning(n_type, "refine-type", "Redef Error: a virtual type cannot be refined.")
+                               modelbuilder.error(n_type, "Redef Error: a virtual type cannot be refined.")
                                break
                        end
                        if not modelbuilder.check_subtype(n_type, mmodule, anchor, bound, supbound) then
index 133d9ee..3f360dc 100644 (file)
@@ -21,6 +21,5 @@ redef class A
 end
 
 var c = new B
-#alt1# c.e = new T
 c.e = new U
 c.e.foo
index 13dcd34..b4034f1 100644 (file)
@@ -1,2 +1 @@
 base_virtual_type4.nit:20,16: Redef Error: a virtual type cannot be refined.
-1
diff --git a/tests/sav/base_virtual_type4_alt1.res b/tests/sav/base_virtual_type4_alt1.res
deleted file mode 100644 (file)
index cae0e93..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-alt/base_virtual_type4_alt1.nit:20,16: Redef Error: a virtual type cannot be refined.
-alt/base_virtual_type4_alt1.nit:24,7--11: Type Error: expected `nullable U`, got `T`.