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

Unified Diff: tests/language/malformed_inheritance_test.dart

Issue 19097003: Support new malformed types semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittests. Created 7 years, 5 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/list_literal_syntax_test.dart ('k') | tests/language/malformed_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/malformed_inheritance_test.dart
diff --git a/tests/language/malformed_inheritance_test.dart b/tests/language/malformed_inheritance_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5473e3bd29bcaed5a928427a4f343ed7f59caf6d
--- /dev/null
+++ b/tests/language/malformed_inheritance_test.dart
@@ -0,0 +1,28 @@
+// 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.
+
+// Tests that malformed types used in extends, implements, and with clauses
+// cause compile-time errors.
+
+import 'package:expect/expect.dart';
+
+class A<T> {}
+
+class C
+ extends Unresolved /// 01: compile-time error
+ extends A<Unresolved> /// 02: static type warning
+ extends Object with Unresolved /// 03: compile-time error
+ extends Object with A<Unresolved> /// 04: static type warning
+ implements Unresolved /// 05: compile-time error
+ implements A<Unresolved> /// 06: static type warning
+{
+
+}
+
+void main() {
+ new C();
+ Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 02: continued
+ Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 04: continued
+ Expect.isTrue(new C() is A<String> && new C() is A<int>); /// 06: continued
+}
« no previous file with comments | « tests/language/list_literal_syntax_test.dart ('k') | tests/language/malformed_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698