| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 /// This is a regression test from issue #29310. The global type-inferrer does |
| 6 /// tracing of closures including allocated classes that implement a `call` |
| 7 /// method. We incorrectly considered also classes with invoked factory |
| 8 /// constructors, even if those were only abstract interfaces or mixins that |
| 9 /// weren't actually allocated explicitly. |
| 10 library regression_29130; |
| 11 |
| 12 main() { |
| 13 new B(); |
| 14 new C(); |
| 15 } |
| 16 |
| 17 class A { |
| 18 call() {} |
| 19 } |
| 20 |
| 21 // interface scenario: we shouldn't trace B |
| 22 abstract class B implements A { |
| 23 factory B() => null; |
| 24 } |
| 25 |
| 26 // mixin scenario: we should trace C, but we should trace _C |
| 27 abstract class C implements A { |
| 28 factory C() => new D(); |
| 29 } |
| 30 |
| 31 class D = A with C; |
| OLD | NEW |