X-Git-Url: http://nitlanguage.org diff --git a/tests/base_attr_isset.nit b/tests/base_attr_isset.nit index f4eee62..bc5ab98 100644 --- a/tests/base_attr_isset.nit +++ b/tests/base_attr_isset.nit @@ -19,31 +19,31 @@ import end interface Object end -universal Int - meth output is intern - meth +(o: Int): Int is intern +enum Int + fun output is intern + fun +(o: Int): Int is intern end -universal Bool - meth output is intern +enum Bool + fun output is intern end class Integer - readable writable attr _val: Int + readable writable var _val: Int init(val: Int) do _val = val - meth output do _val.output + fun output do _val.output end class Foo - attr _a1: Integer - readable attr _a2: Integer - meth run + var _a1: Integer + readable var _a2: Integer + fun run do _a1.output a2.output end - meth show(i: Int) + fun show(i: Int) do i.output (isset _a1).output @@ -55,26 +55,26 @@ class Foo show(1) _a1 = new Integer(1) show(2) - _a2 = new Integer(_a1.val + 1) + _a2 = new Integer(_a1.val + 1) #!alt3# #!alt4# show(3) end - + #alt3# init nop do end end class Bar -special Foo - attr _a3: Integer#!alt1# #!alt2# - #alt1#attr _a3: Integer = new Integer(9000) - #alt2#attr _a3: nullable Integer - redef meth run + super Foo + var _a3: Integer#!alt1# #!alt2# + #alt1#var _a3: Integer = new Integer(9000) + #alt2#var _a3: nullable Integer + redef fun run do _a1.output _a2.output _a3.output end - redef meth show(i) + redef fun show(i) do super (isset _a3).output @@ -93,6 +93,11 @@ special Foo end end +class Baz + super Foo +end + +#alt4# var b2 = new Baz var f = new Foo var b = new Bar f.run