Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: tests/language_strong/generic_methods_simple_as_expression_test.dart

Issue 2765893003: Fix warnings_checker.dart handling of multitests (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 as-expressions. 5 // Test that type parameters in generic methods can be used in as-expressions.
6 6
7 library generic_methods_simple_as_expression_test; 7 library generic_methods_simple_as_expression_test;
8 8
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 10
11 T cast<T>(dynamic obj) { 11 T cast<T>(dynamic obj) {
12 return obj as T; 12 return obj as T;
13 } 13 }
14 14
15 main() { 15 main() {
16 Expect.equals(cast<num>(42), 42); /// 01: ok 16 Expect.equals(cast<num>(42), 42); //# 01: ok
17 cast<String>(42); /// 02: runtime error 17 cast<String>(42); //# 02: runtime error
18 } 18 }
OLDNEW
« no previous file with comments | « tests/language_strong/generic_methods_recursive_bound_test.dart ('k') | tests/language_strong/get_set_syntax_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698