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

Unified Diff: tests/compiler/dart2js_extra/23486_test.dart

Issue 1142873006: Fix bug when using super and prefixes as a parenthesis expression (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « tests/compiler/dart2js_extra/23486_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js_extra/23486_test.dart
diff --git a/tests/compiler/dart2js_extra/23486_test.dart b/tests/compiler/dart2js_extra/23486_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..1d8eb39293eb064e0dacd52be8748e66ba9ab332
--- /dev/null
+++ b/tests/compiler/dart2js_extra/23486_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2015, 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.
+
+// Regression test for http://dartbug.com/23486/
+//
+// Dart2js used to crash when using `super` and prefixes inside parenthesized
+// expressions.
+import 'package:expect/expect.dart';
+
+import '23486_helper.dart' as p;
+
+class B {
+ var field = 1;
+}
+
+class A extends B {
+ m() {
+ (super).field = 1; /// 01: compile-time error
+ }
+}
+
+class C {
+ C();
+ C.name();
+}
+
+class D extends C {
+ D() : super();
+ D.name() : (super).name(); /// 02: compile-time error
+}
+
+main() {
+ Expect.throws(new A().m); /// 01: continued
+ Expect.throws(() => new D.name()); /// 02: continued
+ Expect.throws(() => (p).x); /// 03: static type warning
+}
+
« no previous file with comments | « tests/compiler/dart2js_extra/23486_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698