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

Side by Side Diff: tests/language/cyclic_typedef_test.dart

Issue 13261008: Check for cyclic reference in typedefs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 3 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
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 // Check that cyclic reference of a typedef is a compile-time error.
6
7 // To test various cyclic references the definition of the [:typedef A():] is
8 // split over several lines:
9 typedef
10
11 // Cyclic through return type.
12 A /// 01: compile-time error
13
14 A // The name of the typedef
15
16 ( // The left parenthesis of the typedef arguments.
17
18 // Cyclic through parameter type.
19 A a /// 02: compile-time error
20
21 // Cyclic through optional parameter type.
22 [A a] /// 03: compile-time error
23
24 // Cyclic through named parameter type.
25 {A a} /// 04: compile-time error
26
27 // Cyclic through generic parameter type.
28 List<A> a /// 05: compile-time error
29
30 // Cyclic through return type of function typed parameter.
31 A f() /// 06: compile-time error
32
33 // Cyclic through parameter type of function typed parameter.
34 f(A a) /// 07: compile-time error
35
36 // Cyclic through another typedef.
37 B b /// 08: compile-time error
38
39 // Cyclic through another more typedefs.
40 C c /// 09: compile-time error
41
42 ); // The right parenthesis of the typedef arguments.
43
44 typedef B(A a);
45 typedef C(B b);
46
47 void testA(A a) {}
48
49 void main() {
50 testA(null);
51 }
OLDNEW
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698