nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/linux: implement ToggleEvent
[nit.git]
/
tests
/
base_attr_nullable.nit
diff --git
a/tests/base_attr_nullable.nit
b/tests/base_attr_nullable.nit
index
8961bbb
..
ae29324
100644
(file)
--- a/
tests/base_attr_nullable.nit
+++ b/
tests/base_attr_nullable.nit
@@
-18,25
+18,25
@@
import end
interface Object
end
interface Object
end
-
-universal Int
+enum Bool end
+enum Int
fun output is intern
fun +(o: Int): Int is intern
end
class Integer
fun output is intern
fun +(o: Int): Int is intern
end
class Integer
- readable writable var _val: Int
+ var val: Int
init(val: Int) do _val = val
fun output do _val.output
end
class Foo
init(val: Int) do _val = val
fun output do _val.output
end
class Foo
- var _a1: Integer
- readable var _a2: Integer
+ var a1: Integer is noinit
+ var a2: Integer is noinit
fun run
do
_a1.output
fun run
do
_a1.output
- a2.output
+ _a2.output
end
fun run_other(o: Foo)
end
fun run_other(o: Foo)
@@
-50,15
+50,15
@@
class Foo
#alt1#run
_a1 = new Integer(1)
#alt2#run
#alt1#run
_a1 = new Integer(1)
#alt2#run
- _a2 = new Integer(_a1.val + 1)
+ _a2 = new Integer(_a1._val + 1)
end
init nop do end
end
class Bar
end
init nop do end
end
class Bar
-special Foo
- var _a3: Integer
+ super Foo
+ var a3: Integer is noinit
redef fun run
do
_a1.output
redef fun run
do
_a1.output
@@
-68,7
+68,7
@@
special Foo
init
do
init
do
- nop
+ if false then super # no auto super init call
#alt3#run
_a1 = new Integer(10)
#alt4#run_other(self)
#alt3#run
_a1 = new Integer(10)
#alt4#run_other(self)