modelize_class: Remove the `useless-bound` warning
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Tue, 30 May 2017 03:31:37 +0000 (23:31 -0400)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Tue, 30 May 2017 03:31:37 +0000 (23:31 -0400)
With class subsets, there is no bound that is useless.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

src/modelize/modelize_class.nit
tests/sav/base_gen_final_bound.res [deleted file]
tests/sav/error_class_generic_alt2.res
tests/sav/test_gen_inh.res
tests/sav/test_super_gen.res
tests/sav/test_super_gen_raf.res

index 8164668..53885ad 100644 (file)
@@ -188,9 +188,6 @@ redef class ModelBuilder
                                                bounds.add(bound)
                                                nfd.bound = bound
                                        end
-                                       if bound isa MClassType and bound.mclass.kind == enum_kind then
-                                               warning(nfdt, "useless-bound", "Warning: useless formal parameter type since `{bound}` cannot have subclasses.")
-                                       end
                                else if mclass.mclassdefs.is_empty then
                                        if objectclass == null then
                                                error(nfd, "Error: formal parameter type `{pname}` unbounded but no `Object` class exists.")
diff --git a/tests/sav/base_gen_final_bound.res b/tests/sav/base_gen_final_bound.res
deleted file mode 100644 (file)
index a0d7579..0000000
+++ /dev/null
@@ -1 +0,0 @@
-base_gen_final_bound.nit:23,16--18: Warning: useless formal parameter type since `Int` cannot have subclasses.
index 31fe7ed..ef0f1c9 100644 (file)
@@ -1,2 +1 @@
-alt/error_class_generic_alt2.nit:18,22--26: Warning: useless formal parameter type since `Float` cannot have subclasses.
 alt/error_class_generic_alt2.nit:25,8--12: Type Error: `Array[E: nullable Object]` is a generic class.
index a1e0a96..b48ebc3 100644 (file)
@@ -1,5 +1,3 @@
-test_gen_inh.nit:29,15--17: Warning: useless formal parameter type since `Int` cannot have subclasses.
-test_gen_inh.nit:34,15--17: Warning: useless formal parameter type since `Int` cannot have subclasses.
 11
 22
 33
index 78c1dcc..be0358a 100644 (file)
@@ -1,4 +1,3 @@
-test_super_gen.nit:27,12--14: Warning: useless formal parameter type since `Int` cannot have subclasses.
 1
 0
 5
index 1fc76c7..b2f1f1e 100644 (file)
@@ -1,4 +1,2 @@
-test_super_gen.nit:27,12--14: Warning: useless formal parameter type since `Int` cannot have subclasses.
-test_super_gen_raf.nit:19,12--14: Warning: useless formal parameter type since `Int` cannot have subclasses.
 0
 20