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

Side by Side Diff: tests/language/generic_method_types_test.dart

Issue 2565413002: Fix rti encoding of generic methods (Closed)
Patch Set: Add comment. Created 4 years 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
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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 import 'package:expect/expect.dart';
6
7 typedef O Convert<I, O>(I input);
8 typedef Other(a, b);
9
10 class Mixin<E> {
11 E convert1<I>(I input) => null;
12 }
13
14 class Class<F> extends Object with Mixin<F> {
15 O convert2<O>(F input) => null;
16 }
17
18 O convert<I, O>(I input) => null;
19
20 test1() {
21 var val = new Class<String>();
22 Expect.isTrue(val.convert1 is Convert);
23 Expect.isTrue(val.convert1 is Convert<String, String>);
24 Expect.isTrue(val.convert1 is Convert<int, String>);
25 Expect.isFalse(val.convert1 is Convert<String, int>);
26 Expect.isFalse(val.convert1 is Other);
27 }
28
29 test2() {
30 var val = new Class<String>();
31 Expect.isTrue(val.convert2 is Convert);
32 Expect.isTrue(val.convert2 is Convert<String, String>);
33 Expect.isTrue(val.convert2 is Convert<String, int>);
34 Expect.isFalse(val.convert2 is Convert<int, String>);
35 Expect.isFalse(val.convert2 is Other);
36 }
37
38 test3() {
39 Expect.isTrue(convert is Convert);
40 Expect.isTrue(convert is Convert<String, String>);
41 Expect.isTrue(convert is Convert<String, int>);
42 Expect.isTrue(convert is Convert<int, String>);
43 Expect.isFalse(convert is Other);
44 }
45
46 main() {
47 test1(); /// 01: ok
48 test2(); /// 02: ok
49 test3(); /// 03: ok
50 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/js_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698