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

Unified Diff: tests/language/type_variable_conflict_test.dart

Issue 24650002: Add test for conflicts between type variables and instance or static getters, methods or fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_variable_conflict_test.dart
diff --git a/tests/language/type_variable_conflict_test.dart b/tests/language/type_variable_conflict_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d0e2925798347bb172cd60ae26063e2296377a87
--- /dev/null
+++ b/tests/language/type_variable_conflict_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2013, 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.
+
+// Test that we report a compile-time error when a type parameter conflicts
+// with an instance or static member with the same name.
+
+import "package:expect/expect.dart";
+
+class G1<T> {
+ var T; /// 01: compile-time error
+}
+class G2<T> {
+ get T {} /// 02: compile-time error
+}
+class G3<T> {
+ T() {} /// 03: compile-time error
+}
+class G4<T> {
+ static var T; /// 04: compile-time error
+}
+class G5<T> {
+ static get T {} /// 05: compile-time error
+}
+class G6<T> {
+ static T() {} /// 06: compile-time error
+}
+
+main() {
+ new G1<int>();
+ new G2<int>();
+ new G3<int>();
+ new G4<int>();
+ new G5<int>();
+ new G6<int>();
+}
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698