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

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

Issue 10996039: Bring type variables into static scope, but produce compile-time error when they are used. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Produce warning and dynamic type error instead of compile-time error. Created 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class A<T> { 5 class A<T> {
6 Function closure; 6 Function closure;
7 A._(this.closure); 7 A._(this.closure);
8 8
9 factory A() { 9 factory A() {
10 return new A._(() => new Set<T>()); 10 return new A._(() => new Set<T>());
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 Expect.isTrue(s is Set); 49 Expect.isTrue(s is Set);
50 50
51 s = ((new A<int>()).closure)(); 51 s = ((new A<int>()).closure)();
52 Expect.isTrue(s is Set<int>); 52 Expect.isTrue(s is Set<int>);
53 Expect.isFalse(s is Set<double>); 53 Expect.isFalse(s is Set<double>);
54 54
55 s = ((new A<int>.bar()).closure)(); 55 s = ((new A<int>.bar()).closure)();
56 Expect.isTrue(s is Set<int>); 56 Expect.isTrue(s is Set<int>);
57 Expect.isFalse(s is Set<double>); 57 Expect.isFalse(s is Set<double>);
58 58
59 A.staticMethod("not_null"); 59 var x = A.staticMethod("not_null");
60 print(x);
60 print(A.staticField); 61 print(A.staticField);
61 62
62 A.staticMethod2(null); 63 A.staticMethod2(null);
63 print(A.staticField2); 64 print(A.staticField2);
64 } 65 }
OLDNEW
« lib/compiler/implementation/resolver.dart ('K') | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698