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

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

Issue 32363003: Handle resolution of Class.named<TypeArg> correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 2 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/language/named_constructor_lib.dart ('k') | no next file » | 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 library named_constructor_test;
6
7 import 'package:expect/expect.dart';
8 import 'named_constructor_lib.dart' as prefix;
9
10 class Class<T> {
11 final int value;
12 Class() : value = 0;
13 Class.named() : value = 1;
14 }
15
16 void main() {
17 Expect.equals(0, new Class().value);
18 Expect.equals(0, new Class<int>().value);
19
20 Expect.equals(1, new Class.named().value);
21 Expect.equals(1, new Class<int>.named().value);
22 // 'Class.named' is not a type:
23 Expect.equals(1, new Class.named<int>().value); /// 01: runtime error
24 // 'Class<int>.named<int>' doesn't fit the grammar syntax T.id:
25 Expect.equals(1, new Class<int>.named<int>().value); /// 02: compile-time erro r
26
27 Expect.equals(2, new prefix.Class().value);
28 // 'prefix' is not a type:
29 Expect.equals(2, new prefix<int>.Class().value); /// 03: runtime error
30 Expect.equals(2, new prefix.Class<int>().value);
31 // 'prefix<int>.Class<int>' doesn't fit the grammar syntax T.id:
32 Expect.equals(2, new prefix<int>.Class<int>().value); /// 04: compile-time err or
33
34 Expect.equals(3, new prefix.Class.named().value);
35 // 'prefix<int>.Class.named' doesn't fit the grammar syntax T.id:
36 Expect.equals(3, new prefix<int>.Class.named().value); /// 05: compile-time er ror
37 // 'prefix.Class<int>.named' doesn't fit the grammar syntax T.id:
38 Expect.equals(3, new prefix.Class<int>.named().value);
39 // 'prefix.Class.named<int>' doesn't fit the grammar syntax T.id:
40 Expect.equals(3, new prefix.Class.named<int>().value); /// 06: compile-time er ror
41 // 'prefix<int>.Class<int>' doesn't fit the grammar syntax T.id:
42 Expect.equals(3, new prefix<int>.Class<int>.named().value); /// 07: compile-ti me error
43 // 'prefix<int>.Class.named<int>' doesn't fit the grammar syntax T.id:
44 Expect.equals(3, new prefix<int>.Class.named<int>().value); /// 08: compile-ti me error
45 // 'prefix.Class<int>.named<int>' doesn't fit the grammar syntax T.id:
46 Expect.equals(3, new prefix.Class<int>.named<int>().value); /// 09: compile-ti me error
47 // 'prefix<int>.Class<int>.named<int>' doesn't fit the grammar syntax T.id:
48 Expect.equals(3, new prefix<int>.Class<int>.named<int>().value); /// 10: compi le-time error
49 }
OLDNEW
« no previous file with comments | « tests/language/named_constructor_lib.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698