1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Copyright 2005-2008 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.
21 redef meth output
do _i
.output
22 init(i
: Int) do _i
= i
29 meth outa
(a
: A
) do a
.output
30 meth outb
(b
: B
) do b
.output
35 var na
: nullable A
= new A
(4)
36 var nab
: nullable A
= new B
(5)
37 var nb
: nullable B
= new B
(6)
38 var nan
: nullable A
= null
39 var nbn
: nullable B
= null
45 outa
(nab
.as(not null))
50 #alt1#outb(a.as(not null))
51 #alt2#outb(ab.as(not null))
53 #alt3#outb(na.as(not null))
54 #alt4#outb(nab.as(not null))
59 #alt5#nan.as(not null).output
60 #alt6#nbn.as(not null).output
61 #alt7#null.as(not null).output