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

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: Rebased Created 7 years, 8 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) 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 typedef /*A();*/
ahe 2013/04/02 08:22:39 These comments aren't helping. I think it would b
Johnni Winther 2013/04/02 09:40:14 It looked good in Sublime Text 2! Changed.
6
7 // Cyclic through return type.
8 /*typedef */ A /*A();*/ /// 01: compile-time error
9
10 /*typedef*/ A( /*);*/
11
12 // Cyclic through parameter type.
13 /*typedef A(*/ A a /*);*/ /// 02: compile-time error
14
15 // Cyclic through optional parameter type.
16 /*typedef A(*/ [A a] /*);*/ /// 03: compile-time error
17
18 // Cyclic through named parameter type.
19 /*typedef A(*/ {A a} /*);*/ /// 04: compile-time error
20
21 // Cyclic through generic parameter type.
22 /*typedef A(*/ List<A> a /*);*/ /// 05: compile-time error
23
24 // Cyclic through return type of function typed parameter.
25 /*typedef A(*/ A f() /*);*/ /// 06: compile-time error
26
27 // Cyclic through parameter type of function typed parameter.
28 /*typedef A(*/ f(A a) /*);*/ /// 07: compile-time error
29
30 // Cyclic through another typedef.
31 /*typedef A(*/ B b /*);*/ /// 08: compile-time error
32
33 // Cyclic through another more typedefs.
34 /*typedef A(*/ C c /*);*/ /// 09: compile-time error
35
36 /*typedef A(*/ );
37
38 typedef B(A a);
39 typedef C(B b);
40
41 void testA(A a) {}
42
43 void main() {
44 testA(null);
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698