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

Side by Side Diff: pkg/analyzer/lib/src/summary/summary_sdk.dart

Issue 2023353004: One more fix for SummaryTypeProvider - nullType is lazy. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer.src.summary.summary_sdk; 5 library analyzer.src.summary.summary_sdk;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/dart/element/type.dart'; 8 import 'package:analyzer/dart/element/type.dart';
9 import 'package:analyzer/src/context/cache.dart' show CacheEntry; 9 import 'package:analyzer/src/context/cache.dart' show CacheEntry;
10 import 'package:analyzer/src/context/context.dart'; 10 import 'package:analyzer/src/context/context.dart';
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 @override 343 @override
344 InterfaceType get futureDynamicType { 344 InterfaceType get futureDynamicType {
345 assert(_asyncLibrary != null); 345 assert(_asyncLibrary != null);
346 _futureDynamicType ??= futureType.instantiate(<DartType>[dynamicType]); 346 _futureDynamicType ??= futureType.instantiate(<DartType>[dynamicType]);
347 return _futureDynamicType; 347 return _futureDynamicType;
348 } 348 }
349 349
350 @override 350 @override
351 InterfaceType get futureNullType { 351 InterfaceType get futureNullType {
352 assert(_asyncLibrary != null); 352 assert(_asyncLibrary != null);
353 _futureNullType ??= futureType.instantiate(<DartType>[_nullType]); 353 _futureNullType ??= futureType.instantiate(<DartType>[nullType]);
354 return _futureNullType; 354 return _futureNullType;
355 } 355 }
356 356
357 @override 357 @override
358 InterfaceType get futureType { 358 InterfaceType get futureType {
359 assert(_asyncLibrary != null); 359 assert(_asyncLibrary != null);
360 _futureType ??= _getType(_asyncLibrary, "Future"); 360 _futureType ??= _getType(_asyncLibrary, "Future");
361 return _futureType; 361 return _futureType;
362 } 362 }
363 363
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 * throw a [StateError] if there is no class with the given name. 503 * throw a [StateError] if there is no class with the given name.
504 */ 504 */
505 InterfaceType _getType(LibraryElement library, String name) { 505 InterfaceType _getType(LibraryElement library, String name) {
506 Element element = library.getType(name); 506 Element element = library.getType(name);
507 if (element == null) { 507 if (element == null) {
508 throw new StateError("No definition of type $name"); 508 throw new StateError("No definition of type $name");
509 } 509 }
510 return (element as ClassElement).type; 510 return (element as ClassElement).type;
511 } 511 }
512 } 512 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698