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

Unified Diff: tests/language/mixin_super_constructor_named_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_super_constructor_named_test.dart
diff --git a/tests/language/mixin_super_constructor_named_test.dart b/tests/language/mixin_super_constructor_named_test.dart
index 71afb2a6d0c7ff719d89c57c0e0770bb42ebfd48..068108cba082b15613d5a8fd33e88df395c8d020 100644
--- a/tests/language/mixin_super_constructor_named_test.dart
+++ b/tests/language/mixin_super_constructor_named_test.dart
@@ -6,7 +6,13 @@ import "package:expect/expect.dart";
class Base {
int i, j;
- Base.ctor(int this.i, {int this.j: 10});
+ Base.ctor(int this.i
+ , {int this.j: 10} /// 01: compile-time error
+ ) {
+ if (j == null) {
+ j = 10;
+ }
+ }
}
abstract class M {
@@ -18,17 +24,12 @@ abstract class M {
class C extends Base with M {
int l = 131;
- C.foo() : super.ctor(1, j: 13);
+ C.foo() : super.ctor(1, j: 13); /// 01: compile-time error
C.bar() : super.ctor(1);
}
main() {
- C c1 = new C.foo();
- Expect.equals(1, c1.i);
- Expect.equals(13, c1.j);
- Expect.equals(14, c1.foo());
- Expect.equals(42, c1.k);
- Expect.equals(131, c1.l);
+ C c1 = new C.foo(); /// 01: compile-time error
C c2 = new C.bar();
Expect.equals(1, c2.i);
Expect.equals(10, c2.j);
« no previous file with comments | « tests/language/mixin_forwarding_constructor4_test.dart ('k') | tests/language/mixin_super_constructor_positionals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698