OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 // Tests cyclic reference to type variables in type expressions | |
6 | |
7 typedef void funcType<T | |
8 extends T /// 01: static type error | |
9 >(T arg); | |
gbracha
2012/01/11 23:04:34
We don't have generic functions (or even factories
mmendez
2012/01/12 15:29:50
Unless there is some other countering clause, I th
| |
10 | |
11 | |
12 interface A<S | |
mmendez
2012/01/12 15:29:50
This should be a warning per the spec.
zundel
2012/01/12 15:33:59
Yes. the 'static type error' is at the warning l
| |
13 extends S /// 02: static type error | |
14 > { | |
15 S field; | |
16 } | |
17 | |
18 interface B<U | |
19 extends List<U> /// 03: static type error | |
gbracha
2012/01/11 23:04:34
This should be perfectly legal.
zundel
2012/01/12 12:53:55
How could you make a legal substitution into this?
| |
20 > { | |
21 U field; | |
22 } | |
23 | |
24 class C<V | |
25 extends V /// 04: static type error | |
26 > implements A<V> { | |
27 V field; | |
28 } | |
29 | |
30 class D<W | |
31 extends List<W> /// 05: static type error | |
gbracha
2012/01/11 23:04:34
Again, this is perfectly valid.
| |
32 > implements B<W>{ | |
33 W field; | |
34 } | |
35 | |
36 | |
37 class E<X | |
38 extends funcType<X> /// 06: static type error | |
gbracha
2012/01/11 23:04:34
Since functType isn't valid, the point is moot, bu
| |
39 > { | |
40 X field; | |
41 } | |
42 | |
43 main() { | |
44 new C<List<Object>>(); | |
45 new D<List<Object>>(); | |
46 new E<funcType<Object>>(); | |
47 funcType<Object> val = null; | |
48 } | |
OLD | NEW |