Skip to content

Commit

Permalink
Merge: modelize_property: Promote refine-type to an error
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Beaupré <[email protected]>

Pull-Request: #2287
Reviewed-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Aug 26, 2016
2 parents 40623ba + 0392f58 commit 4b08693
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions src/modelize/modelize_property.nit
Original file line number Diff line number Diff line change
Expand Up @@ -1685,8 +1685,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
Expand Down
1 change: 0 additions & 1 deletion tests/base_virtual_type4.nit
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ redef class A
end

var c = new B
#alt1# c.e = new T
c.e = new U
c.e.foo
1 change: 0 additions & 1 deletion tests/sav/base_virtual_type4.res
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
base_virtual_type4.nit:20,16: Redef Error: a virtual type cannot be refined.
1
2 changes: 0 additions & 2 deletions tests/sav/base_virtual_type4_alt1.res

This file was deleted.

0 comments on commit 4b08693

Please sign in to comment.