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

Unified Diff: tests/compiler/dart2js/kernel/constructors_test.dart

Issue 2607013003: Some constructor fixes: implement redirecting constructors, work with finding default constructors … (Closed)
Patch Set: . Created 4 years 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 | « sdk/bin/dart2js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/kernel/constructors_test.dart
diff --git a/tests/compiler/dart2js/kernel/constructors_test.dart b/tests/compiler/dart2js/kernel/constructors_test.dart
index 1d30c1c548c02003058b1b7c0320a8f1bfccbff6..af38ebd3c2008ed02e3708a062d4e3e1712868ca 100644
--- a/tests/compiler/dart2js/kernel/constructors_test.dart
+++ b/tests/compiler/dart2js/kernel/constructors_test.dart
@@ -33,6 +33,19 @@ main() {
}''';
return check(code, lookup: defaultConstructorFor('A'));
});
+
+test('redirecting constructor with field', () {
+ String code = '''
+class Foo {
+ final int value;
+ const Foo({int number: 0}) : this.poodle(number * 2);
+ const Foo.poodle(this.value);
+}
+
+main() => new Foo(number: 3);
+''';
+ return check(code, lookup: defaultConstructorFor('Foo'));
+ });
}
defaultConstructorFor(String className) => (Compiler compiler) {
« no previous file with comments | « sdk/bin/dart2js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698