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

Unified Diff: tests/language/mixin_forwarding_constructor4_test.dart

Issue 707073002: Fix analyzer's treatment of mixin constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve error message. Created 6 years, 1 month 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/mixin_forwarding_constructor4_test.dart
diff --git a/tests/language/mixin_forwarding_constructor4_test.dart b/tests/language/mixin_forwarding_constructor4_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5230a10a9ccb89542540c86065481b5f127044aa
--- /dev/null
+++ b/tests/language/mixin_forwarding_constructor4_test.dart
@@ -0,0 +1,26 @@
+// 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.
+
+// Verify that when no constructors are forwarded from the base class
+// through a mixin, it is always an error; the mixin does not acquire an
+// implicit default constructor.
+
+abstract class Mixin {}
+
+class Base {
+ Base(
+ {x} /// 01: compile-time error
+ {x} /// 02: compile-time error
+ {x} /// 03: compile-time error
+ );
+}
+
+class C extends Base with Mixin {
+ C(); /// 02: continued
+ C() : super(); /// 03: continued
+}
+
+main() {
+ new C();
+}
« no previous file with comments | « tests/language/mixin_forwarding_constructor3_test.dart ('k') | tests/language/mixin_super_constructor_named_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698