1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2009 Jean Privat <jean@pryen.org>
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
22 fun z
: Object do return fail
30 fun trash
(x
: A
) do end
32 #alt1#fun fail: Fail do return new Fail
33 #alt2#var fail: Fail = new Fail
34 #alt3#var fail = fail(5)
35 #alt4#var fail: Object = 5
36 #alt5#var fail: Object = 5
45 trash
(nok2
) # no rtype
49 trash
(fail
) # no rtype
61 if true then fail
else fail
62 trash
(if fail
then 1 else 2)
63 trash
(if true then 1 else fail
) # no rtype
64 trash
(if true then fail
else fail
) # no rtype
66 while fail
do trash
(0)
69 for i
in fail
do trash
(0) # no rtype (hum...)
70 for i
in [0..1] do fail
72 trash
(once fail
) # no rtype
80 trash
(fail
== 1) # no rtype
82 trash
(fail
== fail
) # no rtype
83 trash
(fail
!= 1) # no rtype
85 trash
(fail
!= fail
) # no rtype
89 trash
(fail
< 1) # no rtype
91 trash
(fail
< fail
) # no rtype
92 trash
(fail
> 1) # no rtype
94 trash
(fail
> fail
) # no rtype
95 trash
(fail
<= 1) # no rtype
97 trash
(fail
<= fail
) # no rtype
98 trash
(fail
>= 1) # no rtype
100 trash
(fail
>= fail
) # no rtype
101 trash
(fail
<=> 1) # no rtype
103 trash
(fail
<=> fail
) # no rtype
104 trash
(fail
+ 1) # no rtype
106 trash
(fail
+ fail
) # no rtype
107 trash
(fail
- 1) # no rtype
109 trash
(fail
- fail
) # no rtype
110 trash
(fail
* 1) # no rtype
112 trash
(fail
* fail
) # no rtype
113 trash
(fail
/ 1) # no rtype
115 trash
(fail
/ fail
) # no rtype
116 trash
(fail
% 1) # no rtype
118 trash
(fail
% fail
) # no rtype
119 trash
(-fail
) # no rtype
122 trash
(str
._fail
) # no rtype
126 trash
(fail
._x
) # no rtype
134 trash
(fail
[1]) # no rtype
139 trash
([1..fail
]) # no rtype
140 trash
([fail
..1]) # no rtype
141 trash
([fail
..fail
]) # no rtype
142 trash
([1..fail
[) # no rtype
143 trash
([fail
..1[) # no rtype
144 trash
([fail
..fail
[) # no rtype
145 trash
([1, fail
]) # no rtype
146 trash
([fail
, 1]) # no rtype
147 trash
([fail
, fail
]) # no rtype
149 trash
("hello{fail}world")
150 trash
(fail
.as(Int)) # no rtype
151 trash
(fail
.as(not null))
152 trash
(fail
isa Int) # no rtype