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

Side by Side Diff: pkg/kernel/testcases/closures/type_variables.dart

Issue 2561723003: Merge kernel closure conversion into the Dart SDK (Closed)
Patch Set: Remove path constraint 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
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.md file.
4
5 class C<T, S> {
6 foo(S s) => (T x) {
7 T y = x;
8 Object z = y;
9 C<T, S> self = this;
10 return z as T;
11 };
12
13 bar() {
14 C<T, S> self = this;
15 }
16
17 baz() {
18 return () => () => new C<T, S>();
19 }
20
21 factory C() {
22 local() {
23 C<T, S> self = new C<T, S>.internal();
24 return self;
25 }
26 return local();
27 }
28 C.internal();
29 }
30
31 main(arguments) {
32 print(new C<String, String>().foo(null)(arguments.first));
33 dynamic c = new C<int, int>().baz()()();
34 if (c is! C<int, int>) throw "$c fails type test 'is C<int, int>'";
35 if (c is C<String, String>) {
36 throw "$c passes type test 'is C<String, String>'";
37 }
38 print(c);
39 }
OLDNEW
« no previous file with comments | « pkg/kernel/testcases/closures/static_tear_off.dart.expect ('k') | pkg/kernel/testcases/closures/type_variables.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698