--- /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 end
+
+interface Object
+end
+
+enum Int
+ fun output is intern
+end
+
+class A
+ fun foo do 1.output
+end
+
+class B
+ super A
+end
+
+class C
+ super B
+ redef fun foo do 2.output
+end
+
+class D
+ super C
+end
+
+class D2
+ super C
+ redef fun foo do 3.output
+end
+
+class E
+ super D
+ super D2
+end
+
+fun test(a: A)
+do
+ a.foo
+end
+
+test(new A)
+test(new B)
+test(new C)
+test(new D)
+test(new D2)
+test(new E)
--- /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 end
+
+interface Object
+ type T: Object
+ fun output do 0.output
+ fun foo: T do return self
+ fun bar(t: T) do t.output
+end
+
+enum Int
+ redef type T: Int
+ redef fun output is intern
+ redef fun foo: T do return self
+ redef fun bar(t: T) do t.output
+end
+
+fun test(o: Object)
+do
+ o.output
+ o.foo.output
+ o.bar(o)
+end
+
+5.output
+5.foo.output
+4.bar(5)
+
+test(5)
--- /dev/null
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2005-2008 Jean Privat <jean@pryen.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 base_simple
+
+class C
+ super A
+ redef fun bar(i: Int)
+ do
+ i.output
+ i.output
+ i.output
+ end
+ fun this_is_a_dead_method
+ do
+ 0.output
+ end
+
+ init
+ do
+ 1.output
+ end
+end
+
+var a = new C # A complex construction
+a.foo(2) # A monormphic call
+a.bar(3) # A polymorphic call
--- /dev/null
+1
+1
+2
+2
+3
+3
--- /dev/null
+5
+5
+5
+5
+5
+5
--- /dev/null
+1
+2
+2
+3
+3
+3