X-Git-Url: http://nitlanguage.org diff --git a/tests/test_variance_param.nit b/tests/test_variance_param.nit index 79ef0f3..9a13498 100644 --- a/tests/test_variance_param.nit +++ b/tests/test_variance_param.nit @@ -17,32 +17,42 @@ class A type T: A type U: B - meth foo(a: T) do a.output - meth bar(b: U) do b.output - meth baz(i: Int) do i.output - redef meth output do 'A'.output + fun foo(a: T) do a.out + fun bar(b: U) do b.out + fun baz(i: Int) do i.out + fun out do 'A'.output init do end end class B -special A + super A redef type T: B redef type U: Int - redef meth foo(a: T) do a.output - redef meth bar(b: U) do b.output - redef meth baz(i: Int) do i.output - redef meth output do 'B'.output + redef fun foo(a: T) do a.out + redef fun bar(b: U) do b.out + redef fun baz(i: Int) do i.out + redef fun out do 'B'.output init do end end redef class Int -special B + super B redef type T: Int - redef meth foo(a: T) do a.output - redef meth bar(b: U) do b.output - redef meth output is intern + redef fun foo(a: T) do a.out + redef fun bar(b: U) do b.out + redef fun output is intern + redef fun out + do + var i: Object = self + if i isa Int then + i.output + else + 'X'.output + end + end + end var a = new A