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

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

Issue 3001803002: Migrate block 114 (and some of 113). (Closed)
Patch Set: Tweak app_jit status. Created 3 years, 3 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 // Test that generic methods with named parameters are of correct type.
6
7 library generic_methods_named_parameters_test;
8
9 import "package:expect/expect.dart";
10
11 typedef FunObjObj = Object Function<T>(Object, {Object y});
12 typedef FunTypObj = Object Function<T>(T, {Object y});
13 typedef FunObjTyp = Object Function<T>(Object, {T y});
14 typedef FunTypTyp = Object Function<T>(T, {T y});
15
16 Object funObjObj<T>(Object x, {Object y}) => x;
17 Object funTypObj<T>(T x, {Object y}) => y;
18 Object funObjTyp<T>(Object x, {T y}) => x;
19 Object funTypTyp<T>(T x, {T y}) => null;
20
21 main() {
22 Expect.isTrue(funObjObj is FunObjObj);
23 Expect.isTrue(funObjObj is FunTypObj);
24 Expect.isTrue(funObjObj is FunObjTyp);
25 Expect.isTrue(funObjObj is FunTypTyp);
26
27 Expect.isTrue(funTypObj is! FunObjObj);
28 Expect.isTrue(funTypObj is FunTypObj);
29 Expect.isTrue(funTypObj is! FunObjTyp);
30 Expect.isTrue(funTypObj is FunTypTyp);
31
32 Expect.isTrue(funObjTyp is! FunObjObj);
33 Expect.isTrue(funObjTyp is! FunTypObj);
34 Expect.isTrue(funObjTyp is FunObjTyp);
35 Expect.isTrue(funObjTyp is FunTypTyp);
36
37 Expect.isTrue(funTypTyp is! FunObjObj);
38 Expect.isTrue(funTypTyp is! FunTypObj);
39 Expect.isTrue(funTypTyp is! FunObjTyp);
40 Expect.isTrue(funTypTyp is FunTypTyp);
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698