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

Unified Diff: tests/language/generic_constructor_mixin2_test.dart

Issue 246563006: Handle generic parameters in synthesized constructor for mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/generic_constructor_mixin2_test.dart
diff --git a/tests/language/generic_constructor_mixin2_test.dart b/tests/language/generic_constructor_mixin2_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..034dd17c7b5fcd246f7822c764de426ced5b0586
--- /dev/null
+++ b/tests/language/generic_constructor_mixin2_test.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2014, 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 parameter types types are checked correctly in the face of
+// mixin application upon a generic constructor.
+
+import 'checked_mode_helper.dart';
+
+class A<X> {
+ A(X x);
+}
+
+class B {}
+class C {}
+
+class D<Y> = A<Y> with B, C;
+
+void main() {
+ var v = 0;
+ checkNoDynamicTypeError(() => new D<int>(v));
+ checkDynamicTypeError(() => new D<String>(v));
+}

Powered by Google App Engine
This is Rietveld 408576698