| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 class A<T> { | 7 class A<T> { |
| 8 @NoInlining() | 8 @NoInline() |
| 9 A(); | 9 A(); |
| 10 | 10 |
| 11 @NoInlining() | 11 @NoInline() |
| 12 foo() => new B<T>(); | 12 foo() => new B<T>(); |
| 13 } | 13 } |
| 14 | 14 |
| 15 class B<T> { | 15 class B<T> { |
| 16 T bar() => null; | 16 T bar() => null; |
| 17 } | 17 } |
| 18 | 18 |
| 19 typedef F(); | 19 typedef F(); |
| 20 typedef F2(x); | 20 typedef F2(x); |
| 21 | 21 |
| 22 // Dart2js realized that the generic type for A was not needed, but then used | 22 // Dart2js realized that the generic type for A was not needed, but then used |
| 23 // it nevertheless when it constructed the closure. | 23 // it nevertheless when it constructed the closure. |
| 24 main() { | 24 main() { |
| 25 var f = new A<int>().foo().bar; | 25 var f = new A<int>().foo().bar; |
| 26 Expect.isTrue(f is F); | 26 Expect.isTrue(f is F); |
| 27 Expect.isFalse(f is F2); | 27 Expect.isFalse(f is F2); |
| 28 } | 28 } |
| OLD | NEW |