| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 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 | 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 // Test that type parameters in generic methods can be used in is-expressions. | 5 // Test that type parameters in generic methods can be used in is-expressions. |
| 6 | 6 |
| 7 library generic_methods_simple_is_expression_test; | 7 library generic_methods_simple_is_expression_test; |
| 8 | 8 |
| 9 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
| 10 | 10 |
| 11 bool fun<T>(int n) { | 11 bool fun<T>(int n) { |
| 12 return n is T; | 12 return n is T; |
| 13 } | 13 } |
| 14 | 14 |
| 15 main() { | 15 main() { |
| 16 Expect.isTrue(fun<int>(42)); | 16 Expect.isTrue(fun<int>(42)); |
| 17 Expect.isFalse(fun<String>(42)); | 17 Expect.isFalse(fun<String>(42)); |
| 18 } | 18 } |
| OLD | NEW |