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

Unified Diff: tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart

Issue 9307010: Type Variables cannot be used in identifier expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart
diff --git a/tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart b/tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..263a2bcc7b94ff7f572e8383cb28d69ed504c58c
--- /dev/null
+++ b/tests/language/src/TypeVariableIdentifierExpressionNegativeTest.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--enable_type_checks
+
+// This te
scheglov 2012/01/31 20:56:19 not finished comment
+
+class A {
+ static func() { return "class A"; }
+}
+
+class B<T> {
+ doFunc() {
+ T.func(); // illegal to use type variable as an identifier expression
+ }
+}
+
+main() {
+ try {
+ var buf = new B<A>().doFunc();
+ print(buf);
+ } catch (Exception e) {
+ // should be an uncatchable compile-time error,
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698