Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_isa_gen1.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2012 Alexandre Terrasa <alexandre@moz-code.org>
4 #
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
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
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.
16
17 import base_minimal
18
19 class A end
20
21 class B[T]
22 super A
23 end
24
25 class C
26 super A
27 end
28
29 class D[T, U]
30 super B[T]
31 super C
32 end
33
34 class E[T]
35 super D[T, Object]
36 end
37
38 class F
39 super D[Object, Object]
40 end
41
42 class G[T: Object]
43 super F
44 end
45
46 class H
47 end
48
49
50
51
52 var a = new A
53 var b = new B[Object]
54 var b2 = new B[H]
55 var b3 = new B[F]
56 var c = new C
57 var d = new D[Object, Object]
58 var e = new E[F]
59 var f = new F
60 var g = new G[Object]
61
62 assert f isa A
63 assert f isa C
64 assert not f isa G[Object]
65 assert g isa D[Object, Object]
66 assert e isa D[Object, Object]
67 assert e isa D[A, Object]
68 assert not e isa D[H, Object]
69 assert e isa D[F, Object]
70
71 true.output