nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modelize: Get most specific init from mclass hierarchy
[nit.git]
/
tests
/
base_var_type_evolution_null4.nit
diff --git
a/tests/base_var_type_evolution_null4.nit
b/tests/base_var_type_evolution_null4.nit
index
18a88d0
..
74821f5
100644
(file)
--- a/
tests/base_var_type_evolution_null4.nit
+++ b/
tests/base_var_type_evolution_null4.nit
@@
-19,13
+19,13
@@
import kernel
class A
end
class A
end
-fun rand: Bool = true
+fun rand: Bool do return true
fun eat_na(a: nullable A) do if a == null then 0.output else 1.output
fun eat_a(a: A) do 2.output
fun eat_na(a: nullable A) do if a == null then 0.output else 1.output
fun eat_a(a: A) do 2.output
-fun get_a: nullable A = new A
-fun get_na: nullable A = null
+fun get_a: nullable A do return new A
+fun get_na: nullable A do return null
var a = get_na
while a == null do
var a = get_na
while a == null do
@@
-50,3
+50,16
@@
loop
end
eat_na(a)
eat_a(a)
end
eat_na(a)
eat_a(a)
+
+a = get_a
+do
+ eat_na(a)
+ if rand and a != null then
+ eat_a(a)
+ break label doblock
+ end
+ abort #alt4#
+end label doblock
+eat_na(a)
+eat_a(a)
+