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

Unified Diff: tests/language/illegal_initializer_test.dart

Issue 107103007: Emit a compile-time error for initializers of the form this.foo and super.foo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/lib/_internal/compiler/implementation/resolution/members.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/illegal_initializer_test.dart
diff --git a/tests/language/inferrer_synthesized_super_constructor2_test.dart b/tests/language/illegal_initializer_test.dart
similarity index 59%
copy from tests/language/inferrer_synthesized_super_constructor2_test.dart
copy to tests/language/illegal_initializer_test.dart
index bb183afe01a133eed72e18bda3383770deb59945..a66829f47442e7b507771642e2f9701bd4c58ed8 100644
--- a/tests/language/inferrer_synthesized_super_constructor2_test.dart
+++ b/tests/language/illegal_initializer_test.dart
@@ -2,19 +2,16 @@
// 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.
-bool inConstructor = false;
-
class A {
- A._() {
- inConstructor = true;
- }
+ A.foo(); /// 01: continued
}
class B extends A {
- B() : super._();
+ B()
+ : super.foo /// 01: compile-time error
floitsch 2013/12/18 08:25:59 Nit: I prefer separate tests that are more targete
karlklose 2013/12/18 10:46:59 Changed it.
+ : this.foo /// 02: compile-time error
+ ;
+ B.foo(); /// 02: continued
}
-main() {
- new B();
- if (!inConstructor) throw 'Test failed';
-}
+main() => new B();
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698