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

Unified Diff: tests/language/field_optimization2_test.dart

Issue 10735051: Fix usage of UNKNOWN/CONFLICTING types for union. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cosmetic change in comment. Created 8 years, 5 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/field_optimization2_test.dart
diff --git a/tests/language/implicit_closure2_test.dart b/tests/language/field_optimization2_test.dart
similarity index 58%
copy from tests/language/implicit_closure2_test.dart
copy to tests/language/field_optimization2_test.dart
index 40c47bec801509d574a197da88cd97f931eeae78..d8b6ec3c2e908fcce428e3106849d8425ff842ce 100644
--- a/tests/language/implicit_closure2_test.dart
+++ b/tests/language/field_optimization2_test.dart
@@ -2,21 +2,23 @@
// 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.
-class B {
- foo(i) => 499 + i;
-}
+// Dart test program to test type-based optimization on fields.
-class A {
- var b;
- A() : b = new B();
- foo(i) { return (() => b.foo(i))(); }
+class A {
+ var x;
+ A() : x = new B();
+ foo() {
+ x++;
+ }
}
+class B {
+ operator +(other) => 498;
+}
main() {
var a = new A();
- Expect.equals(510, a.foo(11));
- var f = a.foo;
- Expect.equals(521, f(22));
+ a.foo();
+ a.foo();
+ Expect.equals(499, a.x);
}
-

Powered by Google App Engine
This is Rietveld 408576698