| Index: tests/language_strong/generic_methods_simple_as_expression_test.dart
|
| diff --git a/tests/language_strong/generic_methods_simple_as_expression_test.dart b/tests/language_strong/generic_methods_simple_as_expression_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..995ca01909bafe16929b45683ec53c6459c09c6f
|
| --- /dev/null
|
| +++ b/tests/language_strong/generic_methods_simple_as_expression_test.dart
|
| @@ -0,0 +1,16 @@
|
| +// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +library generic_methods_simple_as_expression_test;
|
| +
|
| +import "package:expect/expect.dart";
|
| +
|
| +T cast<T>(dynamic obj) {
|
| + return obj as T;
|
| +}
|
| +
|
| +main() {
|
| + Expect.isTrue(cast<num>(42) == 42);
|
| + Expect.throws(() => cast<String>(42), (e) => e is CastError);
|
| +}
|
|
|