nitc: activate warnings by default
authorJean Privat <jean@pryen.org>
Fri, 24 Feb 2012 21:40:32 +0000 (16:40 -0500)
committerJean Privat <jean@pryen.org>
Fri, 24 Feb 2012 21:40:32 +0000 (16:40 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

88 files changed:
src/mmloader.nit
tests/base_closure_default4.nit
tests/base_eq.nit
tests/base_isa_cast2.nit
tests/base_isa_cast4.nit
tests/bench_netsim.nit
tests/sav/base_as_cast.sav
tests/sav/base_as_cast_alt1.sav
tests/sav/base_as_cast_alt2.sav
tests/sav/base_as_cast_alt3.sav
tests/sav/base_as_cast_alt4.sav
tests/sav/base_as_cast_alt5.sav
tests/sav/base_as_cast_alt6.sav
tests/sav/base_as_notnull.sav
tests/sav/base_as_notnull_alt1.sav
tests/sav/base_as_notnull_alt2.sav
tests/sav/base_as_notnull_alt3.sav
tests/sav/base_as_notnull_alt4.sav
tests/sav/base_as_notnull_alt5.sav
tests/sav/base_as_notnull_alt6.sav
tests/sav/base_as_notnull_alt7.sav
tests/sav/base_classid.sav
tests/sav/base_control_flow2.sav
tests/sav/base_control_flow2_alt1.sav
tests/sav/base_control_flow2_alt2.sav
tests/sav/base_control_flow2_alt3.sav
tests/sav/base_control_flow2_alt4.sav
tests/sav/base_control_flow2_alt5.sav
tests/sav/base_control_flow2_alt6.sav
tests/sav/base_control_flow2_alt7.sav
tests/sav/base_eq_null_notnull.sav
tests/sav/base_isa.sav
tests/sav/base_isa_nil.sav
tests/sav/base_upcast2_1alt1.sav
tests/sav/base_upcast2_1alt1_alt1.sav
tests/sav/base_upcast2_1alt1_alt10.sav
tests/sav/base_upcast2_1alt1_alt2.sav
tests/sav/base_upcast2_1alt1_alt3.sav
tests/sav/base_upcast2_1alt1_alt4.sav
tests/sav/base_upcast2_1alt1_alt5.sav
tests/sav/base_upcast2_1alt1_alt6.sav
tests/sav/base_upcast2_1alt1_alt7.sav
tests/sav/base_upcast2_1alt1_alt8.sav
tests/sav/base_upcast2_1alt1_alt9.sav
tests/sav/base_upcast2_1alt4.sav
tests/sav/base_upcast2_1alt4_alt1.sav
tests/sav/base_upcast2_1alt4_alt10.sav
tests/sav/base_upcast2_1alt4_alt2.sav
tests/sav/base_upcast2_1alt4_alt3.sav
tests/sav/base_upcast2_1alt4_alt4.sav
tests/sav/base_upcast2_1alt4_alt5.sav
tests/sav/base_upcast2_1alt4_alt6.sav
tests/sav/base_upcast2_1alt4_alt7.sav
tests/sav/base_upcast2_1alt4_alt8.sav
tests/sav/base_upcast2_1alt4_alt9.sav
tests/sav/base_upcast2_1alt5.sav
tests/sav/base_upcast2_1alt5_alt1.sav
tests/sav/base_upcast2_1alt5_alt10.sav
tests/sav/base_upcast2_1alt5_alt2.sav
tests/sav/base_upcast2_1alt5_alt3.sav
tests/sav/base_upcast2_1alt5_alt4.sav
tests/sav/base_upcast2_1alt5_alt5.sav
tests/sav/base_upcast2_1alt5_alt6.sav
tests/sav/base_upcast2_1alt5_alt7.sav
tests/sav/base_upcast2_1alt5_alt8.sav
tests/sav/base_upcast2_1alt5_alt9.sav
tests/sav/base_var_type_evolution_null3.sav
tests/sav/base_var_type_evolution_null3_alt1.sav
tests/sav/error_expr_not_ok.sav
tests/sav/error_expr_not_ok_alt2.sav
tests/sav/error_expr_not_ok_alt3.sav
tests/sav/error_expr_not_ok_alt4.sav
tests/sav/error_expr_not_ok_alt5.sav
tests/sav/error_expr_not_ok_alt6.sav
tests/sav/error_fun_ret4.sav
tests/sav/error_var_args3.sav
tests/sav/error_var_args4.sav
tests/sav/nitc.sav
tests/sav/nitdoc.sav
tests/sav/test_isa.sav
tests/sav/test_ni_cast_extra.sav
tests/sav/test_ni_operators.sav
tests/sav/test_ni_special_to_native.sav
tests/sav/test_return.sav
tests/sav/test_variance_attr.sav
tests/test_map.nit
tests/test_ni_strings.nit
tests/tests.sh

index 5860f7c..6bd2059 100644 (file)
@@ -153,11 +153,7 @@ class ToolContext
        do
                if _opt_warn.value == 0 then return
                _messages.add(new Message(l,s))
-               if _opt_warn.value == 1 then
-                       _warning_count = _warning_count + 1
-               else
-                       _error_count = _error_count + 1
-               end
+               _warning_count = _warning_count + 1
                if opt_stop_on_first_error.value then check_errors
        end
 
@@ -181,6 +177,9 @@ class ToolContext
        # Option --warn
        readable var _opt_warn: OptionCount = new OptionCount("Show warnings", "-W", "--warn")
 
+       # Option --quiet
+       readable var _opt_quiet: OptionBool = new OptionBool("Do not show warnings", "-q", "--quiet")
+
        # Option --path
        readable var _opt_path: OptionArray = new OptionArray("Set include path for loaders (may be used more than once)", "-I", "--path")
 
@@ -217,18 +216,22 @@ class ToolContext
        init
        do
                super
-               option_context.add_option(opt_warn, opt_stop_on_first_error, opt_no_color, opt_path, opt_log, opt_log_dir, opt_only_parse, opt_only_metamodel, opt_help, opt_version, opt_verbose)
+               option_context.add_option(opt_warn, opt_quiet, opt_stop_on_first_error, opt_no_color, opt_path, opt_log, opt_log_dir, opt_only_parse, opt_only_metamodel, opt_help, opt_version, opt_verbose)
        end
 
        # Parse and process the options given on the command line
        fun process_options
        do
+               self.opt_warn.value = 1
+
                # init options
                option_context.parse(args)
 
                # Set verbose level
                _verbose_level = opt_verbose.value
 
+               if self.opt_quiet.value then self.opt_warn.value = 0
+
                # Setup the paths value
                paths.append(opt_path.value)
 
index cd4f409..bb7b9e9 100644 (file)
@@ -27,7 +27,7 @@ class A
                        #alt6# break
                        #alt7# break 1
                        end
-                       continue (i * 10) #!alt5#
+                       continue  i * 10 #!alt5#
                end
        do
                1.output
index 8c738bb..d09a90d 100644 (file)
@@ -32,7 +32,7 @@ class B
                if not a isa B then
                        return false
                end
-               assert a isa B
+
                return a.a is _a
        end
 
index 782277e..7517281 100644 (file)
@@ -41,7 +41,7 @@ end
 if not a isa B then
        #alt4#a.foo(-4)
        a = new B
-       assert a isa B
+
        a.foo(3)
 end
 a.foo(4)
@@ -56,7 +56,7 @@ end
 while not a isa B do
        #alt7#a.foo(-7)
        a = new B
-       assert a isa B
+
        a.foo(6)
 end
 #alt8#a.foo(7)
index 65ae3d6..252e691 100644 (file)
@@ -40,7 +40,7 @@ end
 #alt1#a.foo(1)
 
 a = new B
-assert a isa B
+
 a.foo(2)
 if maybe then
 else
@@ -49,7 +49,7 @@ end
 #alt2#a.foo(2)
 
 a = new B
-assert a isa B
+
 a.foo(3)
 if maybe then
        a = new A
@@ -58,7 +58,7 @@ end
 #alt3#a.foo(3)
 
 a = new B
-assert a isa B
+
 a.foo(4)
 if maybe then
 else
@@ -66,7 +66,7 @@ end
 a.foo(4)
 
 a = new B
-assert a isa B
+
 a.foo(5)
 if maybe then
        a = new A
@@ -74,14 +74,14 @@ end
 #alt4#a.foo(5)
 
 a = new B
-assert a isa B
+
 a.foo(6)
 if maybe then
 end
 a.foo(6)
 
 a = new B
-assert a isa B
+
 a.foo(7)
 while not maybe do
        #alt5#a = new A
@@ -89,7 +89,7 @@ end
 a.foo(7)
 
 a = new B
-assert a isa B
+
 a.foo(8)
 while not maybe do
 end
index d4a9122..f14a17b 100644 (file)
@@ -41,7 +41,6 @@ class NodeSource
        # Add the sink `n' the the connected nodes
        # Do nothing if `n' is already connected
        do
-               assert n != null
                # Create the collection if needed
                if _nexts == null then
                        _nexts = new ArraySet[NodeSink]
@@ -53,7 +52,6 @@ class NodeSource
        # Remove the sink `n' from the connected nodes
        # Do nothing if `n' is not connected
        do
-               assert n != null
                _nexts.remove(n)
        end
 
@@ -109,7 +107,7 @@ class Scheduler
 
        fun run_for(time_limit: Int)
        do
-               while true do
+               loop
                        var node = next_event 
                        if _time > time_limit then
                                print("Time limit.")
index 4c540f7..38255cb 100644 (file)
@@ -1,3 +1,5 @@
+base_as_cast.nit:42,1--12: Warning: Expression is already a Object.
+base_as_cast.nit:52,1--12: Warning: Expression is already a Object.
 0
 0
 0
index 1f36861..ae868cc 100644 (file)
@@ -1,3 +1,5 @@
+alt/base_as_cast_alt1.nit:42,1--12: Warning: Expression is already a Object.
+alt/base_as_cast_alt1.nit:52,1--12: Warning: Expression is already a Object.
 0
 0
 0
index 2f65e2e..64b54ad 100644 (file)
@@ -1,3 +1,5 @@
+alt/base_as_cast_alt2.nit:42,1--12: Warning: Expression is already a Object.
+alt/base_as_cast_alt2.nit:52,1--12: Warning: Expression is already a Object.
 0
 0
 0
index 17ee9e2..a8b0e5f 100644 (file)
@@ -1,3 +1,5 @@
+alt/base_as_cast_alt3.nit:42,1--12: Warning: Expression is already a Object.
+alt/base_as_cast_alt3.nit:52,1--12: Warning: Expression is already a Object.
 0
 0
 0
index a5d9c2b..4c0f3c4 100644 (file)
@@ -1,3 +1,5 @@
+alt/base_as_cast_alt4.nit:42,1--12: Warning: Expression is already a Object.
+alt/base_as_cast_alt4.nit:52,1--12: Warning: Expression is already a Object.
 0
 0
 0
index 3035f7a..ba014ce 100644 (file)
@@ -1,3 +1,5 @@
+alt/base_as_cast_alt5.nit:42,1--12: Warning: Expression is already a Object.
+alt/base_as_cast_alt5.nit:52,1--12: Warning: Expression is already a Object.
 0
 0
 0
index 03c1c00..171d206 100644 (file)
@@ -1,3 +1,5 @@
+alt/base_as_cast_alt6.nit:42,1--12: Warning: Expression is already a Object.
+alt/base_as_cast_alt6.nit:52,1--12: Warning: Expression is already a Object.
 0
 0
 0
index 8f499ee..f19582e 100644 (file)
@@ -1,3 +1,7 @@
+base_as_notnull.nit:41,6: Warning: 'as(not null)' on non nullable type.
+base_as_notnull.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+base_as_notnull.nit:43,6: Warning: 'as(not null)' on non nullable type.
+base_as_notnull.nit:52,6: Warning: 'as(not null)' on non nullable type.
 1
 2
 3
index 60b7d08..bfed027 100644 (file)
@@ -1 +1,6 @@
+alt/base_as_notnull_alt1.nit:41,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt1.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt1.nit:43,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt1.nit:50,6: Warning: 'as(not null)' on non nullable type.
 alt/base_as_notnull_alt1.nit:50,6--19: Type error: expected B, got A
+alt/base_as_notnull_alt1.nit:52,6: Warning: 'as(not null)' on non nullable type.
index c076807..74ca258 100644 (file)
@@ -1 +1,6 @@
+alt/base_as_notnull_alt2.nit:41,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt2.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt2.nit:43,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt2.nit:51,6--7: Warning: 'as(not null)' on non nullable type.
 alt/base_as_notnull_alt2.nit:51,6--20: Type error: expected B, got A
+alt/base_as_notnull_alt2.nit:52,6: Warning: 'as(not null)' on non nullable type.
index a88beb6..3c376b1 100644 (file)
@@ -1 +1,5 @@
+alt/base_as_notnull_alt3.nit:41,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt3.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt3.nit:43,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt3.nit:52,6: Warning: 'as(not null)' on non nullable type.
 alt/base_as_notnull_alt3.nit:53,6--20: Type error: expected B, got A
index ff16195..bc2fd16 100644 (file)
@@ -1 +1,5 @@
+alt/base_as_notnull_alt4.nit:41,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt4.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt4.nit:43,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt4.nit:52,6: Warning: 'as(not null)' on non nullable type.
 alt/base_as_notnull_alt4.nit:54,6--21: Type error: expected B, got A
index 9d84f09..b9948d9 100644 (file)
@@ -1,3 +1,7 @@
+alt/base_as_notnull_alt5.nit:41,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt5.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt5.nit:43,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt5.nit:52,6: Warning: 'as(not null)' on non nullable type.
 1
 2
 3
index 2176d1d..ee2fa2a 100644 (file)
@@ -1,3 +1,7 @@
+alt/base_as_notnull_alt6.nit:41,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt6.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt6.nit:43,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt6.nit:52,6: Warning: 'as(not null)' on non nullable type.
 1
 2
 3
index 95af7ae..198847b 100644 (file)
@@ -1 +1,5 @@
+alt/base_as_notnull_alt7.nit:41,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt7.nit:42,6--7: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt7.nit:43,6: Warning: 'as(not null)' on non nullable type.
+alt/base_as_notnull_alt7.nit:52,6: Warning: 'as(not null)' on non nullable type.
 alt/base_as_notnull_alt7.nit:61,1--4: Type error: 'as(not null)' on 'null' value.
index 310e632..cbb8328 100644 (file)
@@ -1,3 +1,7 @@
+base_classid.nit:47,2--8: Warning: Expression is already a A.
+base_classid.nit:48,2--9: Warning: Expression is already a A.
+base_classid.nit:49,2--8: Warning: Expression is already a A since it is a B.
+base_classid.nit:52,2--8: Warning: Expression is already a B.
 true
 true
 true
index e69de29..7bb162d 100644 (file)
@@ -0,0 +1,4 @@
+base_control_flow2.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
+base_control_flow2.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
+base_control_flow2.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
+base_control_flow2.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
index 070b940..c24ab44 100644 (file)
@@ -1 +1,5 @@
 alt/base_control_flow2_alt1.nit:24,2: Error: unreachable statement.
+alt/base_control_flow2_alt1.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt1.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt1.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt1.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
index 6a642ac..57fdfa6 100644 (file)
@@ -1 +1,5 @@
+alt/base_control_flow2_alt2.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
 alt/base_control_flow2_alt2.nit:30,2: Error: unreachable statement.
+alt/base_control_flow2_alt2.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt2.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt2.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
index c74ea0f..7585a5f 100644 (file)
@@ -1 +1,5 @@
+alt/base_control_flow2_alt3.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
 alt/base_control_flow2_alt3.nit:42,2: Error: unreachable statement.
+alt/base_control_flow2_alt3.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt3.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt3.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
index 178e0e9..5a3b21a 100644 (file)
@@ -1 +1,5 @@
+alt/base_control_flow2_alt4.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt4.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
 alt/base_control_flow2_alt4.nit:50,3: Error: unreachable statement.
+alt/base_control_flow2_alt4.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt4.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
index f57e89f..fb86643 100644 (file)
@@ -1 +1,5 @@
+alt/base_control_flow2_alt5.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt5.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt5.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
 alt/base_control_flow2_alt5.nit:54,2: Error: unreachable statement.
+alt/base_control_flow2_alt5.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
index fe9e5ca..a0ff1f6 100644 (file)
@@ -1 +1,5 @@
+alt/base_control_flow2_alt6.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt6.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt6.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt6.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
 alt/base_control_flow2_alt6.nit:60,2: Error: unreachable statement.
index 12d94c7..b157466 100644 (file)
@@ -1 +1,5 @@
+alt/base_control_flow2_alt7.nit:21,1--25,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt7.nit:39,1--43,3: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt7.nit:47,2--51,4: Warning: use 'loop' instead of 'while true do'.
+alt/base_control_flow2_alt7.nit:45,1--55,3: Warning: use 'loop' instead of 'while true do'.
 alt/base_control_flow2_alt7.nit:67,2: Error: unreachable statement.
index 41a85bf..7f9ea13 100644 (file)
@@ -1,3 +1,5 @@
+base_eq_null_notnull.nit:36,6--14: Warning: comparaison between null and a non nullable value.
+base_eq_null_notnull.nit:43,2--10: Warning: comparaison between null and a non nullable value.
 true
 true
 true
index b1b808f..57d3ecb 100644 (file)
@@ -1,3 +1,5 @@
+base_isa.nit:39,2--13: Warning: Expression is already a Object.
+base_isa.nit:49,2--13: Warning: Expression is already a Object.
 true
 true
 true
index a9c7347..5ced267 100644 (file)
@@ -1,3 +1,7 @@
+base_isa_nil.nit:33,2--13: Warning: Expression is already a Object.
+base_isa_nil.nit:36,2--22: Warning: Expression is already a nullable Object since it is a Object.
+base_isa_nil.nit:40,2--13: Warning: Prefer '!= null'.
+base_isa_nil.nit:43,2--22: Warning: Expression is already a nullable Object.
 true
 true
 true
index e69de29..70f5a24 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt1.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..970837b 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt1_alt1.nit:26,14--20: Warning: Expression is already a T since it is a C.
index 99abb44..4ebc94a 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt1_alt10.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt1_alt10.nit:36,21: Type error: expected C, got T
index c5765b7..82022ff 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt1_alt2.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt1_alt2.nit:28,21--22: Type error: expected T, got A[Bool]
index e69de29..0172121 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt1_alt3.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..aebee76 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt1_alt4.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..ee4c506 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt1_alt5.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..ab48ba1 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt1_alt6.nit:26,14--20: Warning: Expression is already a T since it is a C.
index 29fe46d..a28de57 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt1_alt7.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt1_alt7.nit:33,22: Type error: expected A[Bool], got T
index 4f33a48..ae3e0e9 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt1_alt8.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt1_alt8.nit:34,22: Type error: expected B[Int], got T
index 3191dca..4c9970f 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt1_alt9.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt1_alt9.nit:35,22: Type error: expected B[Bool], got T
index e69de29..cf976e4 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt4.nit:26,14--20: Warning: Expression is already a T since it is a C.
index b01c65b..e83ff86 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt4_alt1.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt4_alt1.nit:27,21--22: Type error: expected T, got A[Int]
index 7943796..109e8d8 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt4_alt10.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt4_alt10.nit:36,21: Type error: expected C, got T
index b3e05c4..ad146a2 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt4_alt2.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt4_alt2.nit:28,21--22: Type error: expected T, got A[Bool]
index 4b97161..38234bc 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt4_alt3.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt4_alt3.nit:29,21--22: Type error: expected T, got B[Int]
index e69de29..068f89a 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt4_alt4.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..943d7f6 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt4_alt5.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..1fd2c78 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt4_alt6.nit:26,14--20: Warning: Expression is already a T since it is a C.
index 1ce4304..c4c2e99 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt4_alt7.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt4_alt7.nit:33,22: Type error: expected A[Bool], got T
index a636739..5c58539 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt4_alt8.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt4_alt8.nit:34,22: Type error: expected B[Int], got T
index e69de29..f9c5922 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt4_alt9.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..33254c7 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt5.nit:26,14--20: Warning: Expression is already a T since it is a C.
index f831dac..0854e1f 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt5_alt1.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt5_alt1.nit:27,21--22: Type error: expected T, got A[Int]
index e69de29..2599ad5 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt5_alt10.nit:26,14--20: Warning: Expression is already a T since it is a C.
index d640cb1..5cb7814 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt5_alt2.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt5_alt2.nit:28,21--22: Type error: expected T, got A[Bool]
index 3bbdd6e..70454d3 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt5_alt3.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt5_alt3.nit:29,21--22: Type error: expected T, got B[Int]
index b5701dd..c4d547d 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt5_alt4.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt5_alt4.nit:30,21--22: Type error: expected T, got B[Bool]
index e69de29..b5daf1a 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt5_alt5.nit:26,14--20: Warning: Expression is already a T since it is a C.
index e69de29..30ccad9 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt5_alt6.nit:26,14--20: Warning: Expression is already a T since it is a C.
index a670740..86163ea 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt5_alt7.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt5_alt7.nit:33,22: Type error: expected A[Bool], got T
index ce4fd54..45ba2d9 100644 (file)
@@ -1 +1,2 @@
+alt/base_upcast2_1alt5_alt8.nit:26,14--20: Warning: Expression is already a T since it is a C.
 alt/base_upcast2_1alt5_alt8.nit:34,22: Type error: expected B[Int], got T
index e69de29..463ac74 100644 (file)
@@ -0,0 +1 @@
+alt/base_upcast2_1alt5_alt9.nit:26,14--20: Warning: Expression is already a T since it is a C.
index a556a0a..27bb2db 100644 (file)
@@ -1,3 +1,4 @@
+base_var_type_evolution_null3.nit:52,5--13: Warning: comparaison between null and a non nullable value.
 1
 1
 5
index c5d006c..80db667 100644 (file)
@@ -1 +1,2 @@
 alt/base_var_type_evolution_null3_alt1.nit:44,9--10: Type error: expected A, got nullable A
+alt/base_var_type_evolution_null3_alt1.nit:52,5--13: Warning: comparaison between null and a non nullable value.
index 13a1835..c12e1e0 100644 (file)
@@ -30,6 +30,7 @@ error_expr_not_ok.nit:64,30--33: Error: Method or variable 'fail' unknown in Sys
 error_expr_not_ok.nit:66,7--10: Error: Method or variable 'fail' unknown in Sys.
 error_expr_not_ok.nit:66,21: Type error: expected A, got Int
 error_expr_not_ok.nit:67,15--18: Error: Method or variable 'fail' unknown in Sys.
+error_expr_not_ok.nit:67,1--18: Warning: use 'loop' instead of 'while true do'.
 error_expr_not_ok.nit:69,10--13: Error: Method or variable 'fail' unknown in Sys.
 error_expr_not_ok.nit:69,24: Type error: expected A, got Int
 error_expr_not_ok.nit:70,20--23: Error: Method or variable 'fail' unknown in Sys.
index 59d879e..7cd250c 100644 (file)
@@ -16,6 +16,7 @@ alt/error_expr_not_ok_alt2.nit:63,7--30: Type error: expected A, got Int
 alt/error_expr_not_ok_alt2.nit:64,7--33: Type error: expected A, got Int
 alt/error_expr_not_ok_alt2.nit:66,7--10: Type error: expected Bool, got Int
 alt/error_expr_not_ok_alt2.nit:66,21: Type error: expected A, got Int
+alt/error_expr_not_ok_alt2.nit:67,1--18: Warning: use 'loop' instead of 'while true do'.
 alt/error_expr_not_ok_alt2.nit:69,10--13: Type error: Expected a type with an 'iterate' method. Found Int.
 alt/error_expr_not_ok_alt2.nit:69,24: Type error: expected A, got Int
 alt/error_expr_not_ok_alt2.nit:71,8--11: Type error: expected Bool, got Int
@@ -98,6 +99,9 @@ alt/error_expr_not_ok_alt2.nit:145,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt2.nit:146,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt2.nit:147,7--18: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt2.nit:149,7--24: Type error: expected A, got String
+alt/error_expr_not_ok_alt2.nit:150,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt2.nit:150,7--18: Type error: expected A, got Int
+alt/error_expr_not_ok_alt2.nit:151,7--10: Warning: 'as(not null)' on non nullable type.
 alt/error_expr_not_ok_alt2.nit:151,7--23: Type error: expected A, got Int
+alt/error_expr_not_ok_alt2.nit:152,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt2.nit:152,7--18: Type error: expected A, got Bool
index 371b126..8117b44 100644 (file)
@@ -15,6 +15,7 @@ alt/error_expr_not_ok_alt3.nit:63,7--30: Type error: expected A, got Int
 alt/error_expr_not_ok_alt3.nit:64,7--33: Type error: expected A, got Int
 alt/error_expr_not_ok_alt3.nit:66,7--10: Type error: expected Bool, got Int
 alt/error_expr_not_ok_alt3.nit:66,21: Type error: expected A, got Int
+alt/error_expr_not_ok_alt3.nit:67,1--18: Warning: use 'loop' instead of 'while true do'.
 alt/error_expr_not_ok_alt3.nit:69,10--13: Type error: Expected a type with an 'iterate' method. Found Int.
 alt/error_expr_not_ok_alt3.nit:69,24: Type error: expected A, got Int
 alt/error_expr_not_ok_alt3.nit:71,8--11: Type error: expected Bool, got Int
@@ -97,6 +98,9 @@ alt/error_expr_not_ok_alt3.nit:145,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt3.nit:146,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt3.nit:147,7--18: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt3.nit:149,7--24: Type error: expected A, got String
+alt/error_expr_not_ok_alt3.nit:150,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt3.nit:150,7--18: Type error: expected A, got Int
+alt/error_expr_not_ok_alt3.nit:151,7--10: Warning: 'as(not null)' on non nullable type.
 alt/error_expr_not_ok_alt3.nit:151,7--23: Type error: expected A, got Int
+alt/error_expr_not_ok_alt3.nit:152,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt3.nit:152,7--18: Type error: expected A, got Bool
index 6a8abea..6aef1de 100644 (file)
@@ -19,6 +19,7 @@ alt/error_expr_not_ok_alt4.nit:63,7--30: Type error: expected A, got Int
 alt/error_expr_not_ok_alt4.nit:64,7--33: Type error: expected A, got Int
 alt/error_expr_not_ok_alt4.nit:66,7--10: Type error: expected Bool, got Int
 alt/error_expr_not_ok_alt4.nit:66,21: Type error: expected A, got Int
+alt/error_expr_not_ok_alt4.nit:67,1--18: Warning: use 'loop' instead of 'while true do'.
 alt/error_expr_not_ok_alt4.nit:69,10--13: Type error: Expected a type with an 'iterate' method. Found Int.
 alt/error_expr_not_ok_alt4.nit:69,24: Type error: expected A, got Int
 alt/error_expr_not_ok_alt4.nit:71,8--11: Type error: expected Bool, got Int
@@ -101,6 +102,9 @@ alt/error_expr_not_ok_alt4.nit:145,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt4.nit:146,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt4.nit:147,7--18: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt4.nit:149,7--24: Type error: expected A, got String
+alt/error_expr_not_ok_alt4.nit:150,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt4.nit:150,7--18: Type error: expected A, got Int
+alt/error_expr_not_ok_alt4.nit:151,7--10: Warning: 'as(not null)' on non nullable type.
 alt/error_expr_not_ok_alt4.nit:151,7--23: Type error: expected A, got Int
+alt/error_expr_not_ok_alt4.nit:152,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt4.nit:152,7--18: Type error: expected A, got Bool
index 291daf8..92e7b7f 100644 (file)
@@ -20,6 +20,7 @@ alt/error_expr_not_ok_alt5.nit:63,7--30: Type error: expected A, got Int
 alt/error_expr_not_ok_alt5.nit:64,7--33: Type error: expected A, got Int
 alt/error_expr_not_ok_alt5.nit:66,7--10: Type error: expected Bool, got Int
 alt/error_expr_not_ok_alt5.nit:66,21: Type error: expected A, got Int
+alt/error_expr_not_ok_alt5.nit:67,1--18: Warning: use 'loop' instead of 'while true do'.
 alt/error_expr_not_ok_alt5.nit:69,10--13: Type error: Expected a type with an 'iterate' method. Found Int.
 alt/error_expr_not_ok_alt5.nit:69,24: Type error: expected A, got Int
 alt/error_expr_not_ok_alt5.nit:71,8--11: Type error: expected Bool, got Int
@@ -102,6 +103,9 @@ alt/error_expr_not_ok_alt5.nit:145,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt5.nit:146,7--15: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt5.nit:147,7--18: Type error: expected A, got Array[Int]
 alt/error_expr_not_ok_alt5.nit:149,7--24: Type error: expected A, got String
+alt/error_expr_not_ok_alt5.nit:150,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt5.nit:150,7--18: Type error: expected A, got Int
+alt/error_expr_not_ok_alt5.nit:151,7--10: Warning: 'as(not null)' on non nullable type.
 alt/error_expr_not_ok_alt5.nit:151,7--23: Type error: expected A, got Int
+alt/error_expr_not_ok_alt5.nit:152,7--18: Warning: Expression is already a Int.
 alt/error_expr_not_ok_alt5.nit:152,7--18: Type error: expected A, got Bool
index 7fc7a67..d0583fa 100644 (file)
@@ -24,6 +24,7 @@ alt/error_expr_not_ok_alt6.nit:63,7--30: Type error: expected A, got nullable In
 alt/error_expr_not_ok_alt6.nit:64,7--33: Type error: expected A, got null
 alt/error_expr_not_ok_alt6.nit:66,7--10: Type error: expected Bool, got null
 alt/error_expr_not_ok_alt6.nit:66,21: Type error: expected A, got Int
+alt/error_expr_not_ok_alt6.nit:67,1--18: Warning: use 'loop' instead of 'while true do'.
 alt/error_expr_not_ok_alt6.nit:69,10--13: Type error: 'for' on a nullable expression.
 alt/error_expr_not_ok_alt6.nit:69,24: Type error: expected A, got Int
 alt/error_expr_not_ok_alt6.nit:71,8--11: Type error: expected Bool, got null
@@ -47,10 +48,14 @@ alt/error_expr_not_ok_alt6.nit:79,11--14: Type error: expected Bool, got null
 alt/error_expr_not_ok_alt6.nit:79,7--14: Type error: expected A, got Bool
 alt/error_expr_not_ok_alt6.nit:80,7--15: Type error: expected A, got Bool
 alt/error_expr_not_ok_alt6.nit:81,7--15: Type error: expected A, got Bool
+alt/error_expr_not_ok_alt6.nit:81,7--15: Warning: comparaison between null and a non nullable value.
 alt/error_expr_not_ok_alt6.nit:82,7--18: Type error: expected A, got Bool
+alt/error_expr_not_ok_alt6.nit:82,7--18: Warning: comparaison between two null values.
 alt/error_expr_not_ok_alt6.nit:83,7--15: Type error: expected A, got Bool
 alt/error_expr_not_ok_alt6.nit:84,7--15: Type error: expected A, got Bool
+alt/error_expr_not_ok_alt6.nit:84,7--15: Warning: comparaison between null and a non nullable value.
 alt/error_expr_not_ok_alt6.nit:85,7--18: Type error: expected A, got Bool
+alt/error_expr_not_ok_alt6.nit:85,7--18: Warning: comparaison between two null values.
 alt/error_expr_not_ok_alt6.nit:86,7--15: Type error: expected A, got Bool
 alt/error_expr_not_ok_alt6.nit:87,7--15: Type error: expected A, got Bool
 alt/error_expr_not_ok_alt6.nit:88,7--18: Type error: expected A, got Bool
@@ -120,6 +125,8 @@ alt/error_expr_not_ok_alt6.nit:146,7--15: Type error: expected A, got Array[null
 alt/error_expr_not_ok_alt6.nit:147,7--18: Type error: expected A, got Array[null]
 alt/error_expr_not_ok_alt6.nit:149,14--17: Type error: expected Object, got null
 alt/error_expr_not_ok_alt6.nit:149,7--24: Type error: expected A, got String
+alt/error_expr_not_ok_alt6.nit:150,7--18: Warning: Expression is null therefore cannot be a Int.
 alt/error_expr_not_ok_alt6.nit:150,7--18: Type error: expected A, got Int
 alt/error_expr_not_ok_alt6.nit:151,7--10: Type error: 'as(not null)' on 'null' value.
+alt/error_expr_not_ok_alt6.nit:152,7--18: Warning: Expression is null therefore cannot be a Int.
 alt/error_expr_not_ok_alt6.nit:152,7--18: Type error: expected A, got Bool
index 36e13a8..b4df42d 100644 (file)
@@ -1 +1,2 @@
 error_fun_ret4.nit:17,5--8: Control error: Reached end of function (a 'return' with a value was expected).
+error_fun_ret4.nit:19,2--22,4: Warning: use 'loop' instead of 'while true do'.
index 1683b26..4c5bf5d 100644 (file)
@@ -1 +1,2 @@
+error_var_args3.nit:18,2--3: Warning: superfluous parentheses.
 error_var_args3.nit:18,1--3: Error: t is variable, not a function.
index a3329e7..d109c88 100644 (file)
@@ -1 +1,2 @@
+error_var_args4.nit:18,2--3: Warning: superfluous parentheses.
 error_var_args4.nit:18,1--8: Error: t is variable, not a function.
index b8426ea..17c0459 100644 (file)
@@ -1,5 +1,6 @@
 usage: nitc [options] file...
   -W, --warn                      Show warnings
+  -q, --quiet                     Do not show warnings
   --stop-on-first-error           Stop on first error
   --no-color                      Do not use color to display errors and warnings
   -I, --path                      Set include path for loaders (may be used more than once)
index 609793f..7e0f795 100644 (file)
@@ -1,5 +1,6 @@
 usage: nitdoc [options] file...
   -W, --warn              Show warnings
+  -q, --quiet             Do not show warnings
   --stop-on-first-error   Stop on first error
   --no-color              Do not use color to display errors and warnings
   -I, --path              Set include path for loaders (may be used more than once)
index 588e256..24304a1 100644 (file)
@@ -1,3 +1,6 @@
+test_isa.nit:25,7--19: Warning: Expression is already a Object.
+test_isa.nit:34,7--19: Warning: Expression is already a Object.
+test_isa.nit:43,7--28: Warning: Expression is already a nullable Object.
 int:
 true
 true
index 22cbe65..d9f08d7 100644 (file)
@@ -1,3 +1,4 @@
+test_ni_cast_extra.nit:50,21--28: Warning: comparaison between null and a non nullable value.
 a isa b false (expected: false)
 c isa a true (expected: true)
 d isa b true (expected: true)
index ad8f392..625c36c 100644 (file)
@@ -1,3 +1,4 @@
+test_ni_operators.nit:77,7--25: Warning: comparaison between null and a non nullable value.
 11
 9
 22
index c03e006..7acfbdb 100644 (file)
@@ -1,3 +1,5 @@
+test_ni_special_to_native.nit:37,1--7: Warning: Expression is already a A since it is a B.
+test_ni_special_to_native.nit:38,1--7: Warning: Expression is already a A since it is a B.
 A
 A from native
 B
index 627e109..b3dd2f3 100644 (file)
@@ -1,3 +1,4 @@
+test_return.nit:45,2--47,4: Warning: use 'loop' instead of 'while true do'.
 1
 1
 1
index e7db980..cc07825 100644 (file)
@@ -1,3 +1,5 @@
+test_variance_attr.nit:28,15--18: Redef warning: Expected nullable Object, as in A::_foo.
+test_variance_attr.nit:29,15--18: Redef warning: Expected nullable A, as in A::_bar.
 AB1
 AB1
 1
index e356e0f..c5b9eea 100644 (file)
@@ -52,7 +52,7 @@ do
 
        i = nb
        while i >= 0 do
-               if (h[i*31+13] != i * 2) then
+               if h[i*31+13] != i * 2 then
                        print("{i}: {i*31+13} != {h[i]}")
                end
                i = i - 1
@@ -60,7 +60,7 @@ do
 
        i = nb * 2
        while i >= 0 do
-               if (i % 3 != 0) then
+               if i % 3 != 0 then
                        h.values.remove(i)
                end
                i = i - 1
@@ -75,7 +75,7 @@ do
                        if h.has_key(j) then
                                print("{i}: {j} should be removed")
                        end
-               else if (h[j] != i * 2) then
+               else if h[j] != i * 2 then
                        print("{i}: {j} != {h[i]}")
                end
                i = i - 1
index 962db1a..ad05cb3 100644 (file)
@@ -20,7 +20,7 @@ class A
 
        fun get_nstr_from_str( str : String ) : NativeString is extern import String::to_cstring
 
-       fun get_something() : String is extern import String::from_cstring
+       fun get_something : String is extern import String::from_cstring
 end
 
 var a = new A
@@ -29,6 +29,6 @@ print a.get_str_from_nstr_with_len( "hello world?".to_cstring )
 print new String.from_cstring( a.get_nstr_from_str( "hello world!" ) )
 
 
-var something = a.get_something() # expects "something"
+var something = a.get_something # expects "something"
 print something
 print something.length
index 0ee0fde..a1d0f99 100755 (executable)
@@ -201,6 +201,7 @@ for ii in "$@"; do
                        cp "$ff.cmp.err" "$ff.res"
                        process_result $ff
                elif [ -x "./$ff.bin" ]; then
+                       cp "$ff.cmp.err" "$ff.res"
                        echo -n ". "
                        # Execute
                        args=""
@@ -209,9 +210,9 @@ for ii in "$@"; do
                                echo "NIT_NO_STACK=1 ./$ff.bin" $args
                        fi
                        if [ -f "$f.inputs" ]; then
-                               NIT_NO_STACK=1 "./$ff.bin" $args < "$f.inputs" > "$ff.res" 2>"$ff.err"
+                               NIT_NO_STACK=1 "./$ff.bin" $args < "$f.inputs" >> "$ff.res" 2>"$ff.err"
                        else
-                               NIT_NO_STACK=1 "./$ff.bin" $args > "$ff.res" 2>"$ff.err"
+                               NIT_NO_STACK=1 "./$ff.bin" $args >> "$ff.res" 2>"$ff.err"
                        fi
                        if [ "x$verbose" = "xtrue" ]; then
                                cat "$ff.res"