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

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

Issue 2737933002: Add tests for generic methods in strong mode (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
(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 library generic_methods_dynamic_test;
6
7 import "package:expect/expect.dart";
8
9 class A {}
10
11 class B {}
12
13 class C {
14 T fun<T>(T t) => t;
15 }
16
17 main() {
18 B b = new B();
19 C c = new C();
20 dynamic obj = c;
21
karlklose 2017/03/09 09:17:00 Use multi-tests? c.fun<A>(b); /// 01: compile-ti
Dmitry Stefantsov 2017/03/10 13:21:53 Thanks! I put the checks for both compile-type err
22 Expect.throws(() => obj.fun<A>(b), (e) => e is TypeError);
karlklose 2017/03/09 09:17:00 () => obj.fun<A>(b); /// 02: runtime error
eernst 2017/03/09 14:55:02 This tests one of the cases I mentioned above in g
Dmitry Stefantsov 2017/03/10 13:21:53 Probably, it should be 'obj.fun<A>(b);', otherwise
Dmitry Stefantsov 2017/03/10 13:21:53 Done.
23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698