Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: tests/language/src/CyclicTypeVariableTest.dart

Issue 9186017: Fix crash in dartc when given cyclic type variable bounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated test Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 class Base<T> {}
8
9 class Derived extends Base<Derived> {} // legal
10
11 typedef void funcType<T
12 extends T /// 01: static type error
gbracha 2012/01/13 22:53:47 Again, this is syntactically invalid.
zundel 2012/01/17 13:17:03 Not a syntax error acc'd to the spec from what we
zundel 2012/01/17 13:19:17 (I can easily change the parser, but I think there
13 >(T arg);
14
15 class DerivedFunc extends Base<funcType<DerivedFunc>> { }
16
17
18 interface A<S
19 extends S /// 02: static type error
20 > {
21 S field;
22 }
23
24 interface B<U extends Base<U>> { // legal
25 U field;
26 }
27
28 class C1<V
29 extends V /// 03: static type error
30 > {
31 V field;
32 }
33
34 class C2<V
35 extends V /// 04: static type error
36 > implements A<V> {
37 V field;
38 }
39
40 class D1<W extends Base<W>> { // legal
41 W field;
42 }
43
44 class D2<W extends Base<W>> implements B<W>{ // legal
45 W field;
46 }
47
48 class E<X extends Base<funcType<X>>> { // legal
49
50 X field;
51 }
52
53
54 main() {
55 new C1<int>();
56 new C2<int>();
57 new D1<Derived>();
58 new D2<Derived>();
59 new E<DerivedFunc>();
60 funcType<Object> val = null;
61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698