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

Side by Side Diff: pkg/kernel/lib/testing/mock_sdk_program.dart

Issue 2892593005: Handle FutureOr type when inferring async closures. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « pkg/kernel/lib/core_types.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
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 import 'package:kernel/ast.dart'; 5 import 'package:kernel/ast.dart';
6 6
7 /// Returns a [Program] object containing empty definitions of core SDK classes. 7 /// Returns a [Program] object containing empty definitions of core SDK classes.
8 Program createMockSdkProgram() { 8 Program createMockSdkProgram() {
9 var coreLib = new Library(Uri.parse('dart:core'), name: 'dart.core'); 9 var coreLib = new Library(Uri.parse('dart:core'), name: 'dart.core');
10 var asyncLib = new Library(Uri.parse('dart:async'), name: 'dart.async'); 10 var asyncLib = new Library(Uri.parse('dart:async'), name: 'dart.async');
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 addClass( 53 addClass(
54 coreLib, class_('Map', typeParameters: [typeParam('K'), typeParam('V')])); 54 coreLib, class_('Map', typeParameters: [typeParam('K'), typeParam('V')]));
55 addClass(coreLib, class_('int', supertype: num.asThisSupertype)); 55 addClass(coreLib, class_('int', supertype: num.asThisSupertype));
56 addClass(coreLib, class_('double', supertype: num.asThisSupertype)); 56 addClass(coreLib, class_('double', supertype: num.asThisSupertype));
57 addClass(coreLib, class_('Iterator', typeParameters: [typeParam('T')])); 57 addClass(coreLib, class_('Iterator', typeParameters: [typeParam('T')]));
58 addClass(coreLib, class_('Symbol')); 58 addClass(coreLib, class_('Symbol'));
59 addClass(coreLib, class_('Type')); 59 addClass(coreLib, class_('Type'));
60 addClass(coreLib, class_('Function')); 60 addClass(coreLib, class_('Function'));
61 addClass(coreLib, class_('Invocation')); 61 addClass(coreLib, class_('Invocation'));
62 addClass(asyncLib, class_('Future', typeParameters: [typeParam('T')])); 62 addClass(asyncLib, class_('Future', typeParameters: [typeParam('T')]));
63 addClass(asyncLib, class_('FutureOr', typeParameters: [typeParam('T')]));
63 addClass(asyncLib, class_('Stream', typeParameters: [typeParam('T')])); 64 addClass(asyncLib, class_('Stream', typeParameters: [typeParam('T')]));
64 addClass(internalLib, class_('Symbol')); 65 addClass(internalLib, class_('Symbol'));
65 66
66 return new Program(libraries: [coreLib, asyncLib, internalLib]); 67 return new Program(libraries: [coreLib, asyncLib, internalLib]);
67 } 68 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/core_types.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698