| Index: tests/compiler/dart2js/field_type_simple_inferer_test.dart
|
| ===================================================================
|
| --- tests/compiler/dart2js/field_type_simple_inferer_test.dart (revision 20142)
|
| +++ tests/compiler/dart2js/field_type_simple_inferer_test.dart (working copy)
|
| @@ -398,6 +398,32 @@
|
| }
|
| """;
|
|
|
| +const String TEST_24 = r"""
|
| + class A {
|
| + var f1 = 42;
|
| + var f2 = 42;
|
| + var f3 = 42;
|
| + final f4;
|
| + var f5;
|
| + A() : f4 = 42 {
|
| + f1++;
|
| + f2 += 42;
|
| + }
|
| + A.foo(other) : f3 = other.f3, f4 = other.f4, f5 = other.bar();
|
| + operator+(other) => 'foo';
|
| + bar() => 42.5;
|
| + }
|
| + class B extends A {
|
| + bar() => 42;
|
| + }
|
| + main() {
|
| + new A();
|
| + new A.foo(new A());
|
| + new A.foo(new B());
|
| +
|
| + }
|
| +""";
|
| +
|
| void doTest(String test, bool disableInlining, Map<String, Function> fields) {
|
| fields.forEach((String name, Function f) {
|
| compileAndFind(
|
| @@ -471,6 +497,12 @@
|
| 'f2': (inferrer) => inferrer.intType.nullable(),
|
| 'f3': (inferrer) => inferrer.intType.nullable(),
|
| 'f4': (inferrer) => inferrer.intType.nullable()});
|
| +
|
| + runTest(TEST_24, {'f1': (inferrer) => inferrer.numType,
|
| + 'f2': (inferrer) => inferrer.numType,
|
| + 'f3': (inferrer) => inferrer.intType,
|
| + 'f4': (inferrer) => inferrer.intType,
|
| + 'f5': (inferrer) => inferrer.numType.nullable()});
|
| }
|
|
|
| void main() {
|
|
|