--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import standard::kernel
+
+
+interface A
+end
+
+class B
+ super A
+ var next: A
+end
+
+class C
+ super A
+end
+
+class D
+ super A
+end
+
+fun foo(a: A): Int
+do
+ var i = 0
+ if a isa B then while i < 10 do
+ i += 1
+
+ if a isa C then return i
+ if not a isa B then return -i
+ a = a.next #alt1#
+ end
+ return i
+end
+
+var c = new C
+var b = new B(c)
+var bd = new B(new D)
+foo(c).output
+foo(b).output
+foo(bd).output
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import standard::kernel
+
+var x
+x = null
+
+var i = 0
+while i < 2 do
+ var y
+ y = x
+ if y == null then 1.output
+ y = x
+ if y != null then 2.output
+ y = x
+ if y isa Int then 3.output
+ y = x
+ if y isa nullable Int then 4.output
+ y = x
+ if y isa nullable Bool then 5.output
+ y = x or else 6
+ y.output
+ #alt1#x = 1
+
+ i += 1
+end
+
+x = 10
+i = 0
+while i < 2 do
+ var y
+ y = x
+ if y == null then 1.output
+ y = x
+ if y != null then 2.output
+ y = x
+ if y isa Int then 3.output
+ y = x
+ if y isa nullable Int then 4.output
+ y = x
+ if y isa nullable Bool then 5.output
+ y = x or else 6
+ y.output
+ #alt1#x = null
+
+ i += 1
+end
--- /dev/null
+alt/base_adaptive_loop_isa_alt1.nit:41,10--16: Warning: expression is already a `B`.
+0
+10
+10
--- /dev/null
+base_adaptive_loop_null2.nit:24,5: Warning: expression is always `null`.
+base_adaptive_loop_null2.nit:26,5: Warning: expression is always `null`.
+base_adaptive_loop_null2.nit:30,5--22: Warning: expression is already a `nullable Int` since it is a `null`.
+base_adaptive_loop_null2.nit:32,5--23: Warning: expression is already a `nullable Bool` since it is a `null`.
+base_adaptive_loop_null2.nit:33,6: Warning: expression is always `null`.
+base_adaptive_loop_null2.nit:45,5: Warning: expression is not null, since it is a `Int`.
+base_adaptive_loop_null2.nit:47,5: Warning: expression is not null, since it is a `Int`.
+base_adaptive_loop_null2.nit:49,5--13: Warning: expression is already a `Int`.
+base_adaptive_loop_null2.nit:51,5--22: Warning: expression is already a `nullable Int` since it is a `Int`.
+base_adaptive_loop_null2.nit:54,6: Warning: expression is not null, since it is a `Int`.
+1
+4
+5
+6
+1
+4
+5
+6
+2
+3
+4
+10
+2
+3
+4
+10
--- /dev/null
+alt/base_adaptive_loop_null2_alt1.nit:30,5--22: Warning: expression is already a `nullable Int`.
+alt/base_adaptive_loop_null2_alt1.nit:51,5--22: Warning: expression is already a `nullable Int`.
+1
+4
+5
+6
+2
+3
+4
+1
+2
+3
+4
+10
+1
+4
+5
+6
+alt/base_adaptive_loop_null_alt1.nit:23,7: Warning: expression is always `null`.
0