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

Unified Diff: tests/language/field_optimization_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_optimization_test.dart
diff --git a/tests/language/field_optimization_test.dart b/tests/language/field_optimization_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9dea38ba79996a047211caf9a59fc4e7fd7fcc2c
--- /dev/null
+++ b/tests/language/field_optimization_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2012, 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.
+
+// Dart test program to test type-based optimization on fields.
+
+
+class A {
+ var x;
+ A() : x = 0;
+ foo() {
+ x++;
+ }
+ toto() {
+ x = 99;
+ }
+ bar(y) {
+ x = y;
+ }
+}
+
+class B {
+ operator +(other) => "ok";
+}
+main() {
+ var a = new A();
+ a.foo();
+ a.toto();
+ a.bar("str");
+ a.bar(new B());
+ a.foo();
+ Expect.equals("ok", a.x);
+}
« lib/compiler/implementation/ssa/types.dart ('K') | « tests/language/field_optimization2_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698