OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, 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 // Test handling of type variable in field initializers. |
| 6 |
| 7 import 'package:expect/expect.dart'; |
| 8 |
| 9 class Mixin<S> { |
| 10 var field = (S s) => null; |
| 11 } |
| 12 |
| 13 class Class<T> extends Object with Mixin<T> {} |
| 14 |
| 15 void main() { |
| 16 Expect.isTrue(test(new Mixin<int>())); |
| 17 Expect.isFalse(test(new Mixin<String>())); //# 01: ok |
| 18 Expect.isTrue(test(new Class<int>())); |
| 19 Expect.isFalse(test(new Class<String>())); //# 02: ok |
| 20 } |
| 21 |
| 22 test(o) => o.field is dynamic Function(int); |
OLD | NEW |