OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import "package:expect/expect.dart"; |
| 6 |
| 7 class A<T> { |
| 8 @NoInlining() |
| 9 A(); |
| 10 |
| 11 @NoInlining() |
| 12 foo() => new B<T>(); |
| 13 } |
| 14 |
| 15 class B<T> { |
| 16 T bar() => null; |
| 17 } |
| 18 |
| 19 typedef F(); |
| 20 typedef F2(x); |
| 21 |
| 22 // Dart2js realized that the generic type for A was not needed, but then used |
| 23 // it nevertheless when it constructed the closure. |
| 24 main() { |
| 25 var f = new A<int>().foo().bar; |
| 26 Expect.isTrue(f is F); |
| 27 Expect.isFalse(f is F2); |
| 28 } |
OLD | NEW |