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

Unified Diff: tests/language/multiple_field_assignment_constructor_test.dart

Issue 15725018: Fix bug in SsaConstructionFieldTypes: handle mulitple assignments to the same field. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
Index: tests/language/multiple_field_assignment_constructor_test.dart
===================================================================
--- tests/language/multiple_field_assignment_constructor_test.dart (revision 0)
+++ tests/language/multiple_field_assignment_constructor_test.dart (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2013, 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.
+
+import "package:expect/expect.dart";
+
+class NoInline {
kasperl 2013/06/06 08:15:12 DontInline?
ngeoffray 2013/06/06 08:44:00 Done.
+ const NoInline();
+}
+
+var a = [null];
+
+class A {
+ var foo;
+ var bar;
+
+ @NoInline
kasperl 2013/06/06 08:15:12 What's the purpose of this annotation? Are you exp
ngeoffray 2013/06/06 08:44:00 Yeah, more like a marker that this test depends on
kasperl 2013/06/06 08:45:30 SGTM!
+ A() {
+ // Currently defeat inlining by using a closure.
+ bar = () => 42;
+ foo = 42;
+ foo = a[0];
+ }
+}
+
+main() {
+ new A();
+ bar();
+ new A();
+}
+
+@NoInline
+bar() {
+ // Currently defeat inlining by using a closure.
+ Expect.throws(() => new A().foo + 42, (e) => e is NoSuchMethodError);
+}

Powered by Google App Engine
This is Rietveld 408576698