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

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

Issue 9186017: Fix crash in dartc when given cyclic type variable bounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated unit test 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
« no previous file with comments | « tests/language/language-leg.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/CyclicTypeVariableTest.dart
diff --git a/tests/language/src/CyclicTypeVariableTest.dart b/tests/language/src/CyclicTypeVariableTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f3f95fe22f67997a7c3c2950141cfb594a7a4629
--- /dev/null
+++ b/tests/language/src/CyclicTypeVariableTest.dart
@@ -0,0 +1,48 @@
+// 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.
+
+// Tests cyclic reference to type variables in type expressions
+
+typedef void funcType<T
+extends T /// 01: static type error
+>(T arg);
gbracha 2012/01/11 23:04:34 We don't have generic functions (or even factories
mmendez 2012/01/12 15:29:50 Unless there is some other countering clause, I th
+
+
+interface A<S
mmendez 2012/01/12 15:29:50 This should be a warning per the spec.
zundel 2012/01/12 15:33:59 Yes. the 'static type error' is at the warning l
+extends S /// 02: static type error
+> {
+ S field;
+}
+
+interface B<U
+extends List<U> /// 03: static type error
gbracha 2012/01/11 23:04:34 This should be perfectly legal.
zundel 2012/01/12 12:53:55 How could you make a legal substitution into this?
+> {
+ U field;
+}
+
+class C<V
+extends V /// 04: static type error
+> implements A<V> {
+ V field;
+}
+
+class D<W
+extends List<W> /// 05: static type error
gbracha 2012/01/11 23:04:34 Again, this is perfectly valid.
+> implements B<W>{
+ W field;
+}
+
+
+class E<X
+extends funcType<X> /// 06: static type error
gbracha 2012/01/11 23:04:34 Since functType isn't valid, the point is moot, bu
+> {
+ X field;
+}
+
+main() {
+ new C<List<Object>>();
+ new D<List<Object>>();
+ new E<funcType<Object>>();
+ funcType<Object> val = null;
+}
« no previous file with comments | « tests/language/language-leg.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698