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

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

Issue 1713593002: Store return types of variable initializers in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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
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 summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 int numTypeParameters = linkedReference.numTypeParameters; 1890 int numTypeParameters = linkedReference.numTypeParameters;
1891 if (linkedReference.kind == ReferenceKind.unresolved) { 1891 if (linkedReference.kind == ReferenceKind.unresolved) {
1892 type = summaryResynthesizer.typeProvider.undefinedType; 1892 type = summaryResynthesizer.typeProvider.undefinedType;
1893 element = null; 1893 element = null;
1894 } else if (name == 'dynamic') { 1894 } else if (name == 'dynamic') {
1895 type = summaryResynthesizer.typeProvider.dynamicType; 1895 type = summaryResynthesizer.typeProvider.dynamicType;
1896 element = type.element; 1896 element = type.element;
1897 } else if (name == 'void') { 1897 } else if (name == 'void') {
1898 type = VoidTypeImpl.instance; 1898 type = VoidTypeImpl.instance;
1899 element = type.element; 1899 element = type.element;
1900 } else if (name == '*bottom*') {
1901 type = BottomTypeImpl.instance;
1902 element = null;
1900 } else { 1903 } else {
1901 List<String> locationComponents; 1904 List<String> locationComponents;
1902 if (enclosingInfo != null && enclosingInfo.element is ClassElement) { 1905 if (enclosingInfo != null && enclosingInfo.element is ClassElement) {
1903 String identifier = _getElementIdentifier(name, linkedReference.kind); 1906 String identifier = _getElementIdentifier(name, linkedReference.kind);
1904 locationComponents = 1907 locationComponents =
1905 enclosingInfo.element.location.components.toList(); 1908 enclosingInfo.element.location.components.toList();
1906 locationComponents.add(identifier); 1909 locationComponents.add(identifier);
1907 } else { 1910 } else {
1908 String identifier = _getElementIdentifier(name, linkedReference.kind); 1911 String identifier = _getElementIdentifier(name, linkedReference.kind);
1909 locationComponents = getReferencedLocationComponents( 1912 locationComponents = getReferencedLocationComponents(
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 } 2230 }
2228 : () => this.element; 2231 : () => this.element;
2229 // TODO(paulberry): Is it a bug that we have to pass `false` for 2232 // TODO(paulberry): Is it a bug that we have to pass `false` for
2230 // isInstantiated? 2233 // isInstantiated?
2231 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); 2234 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false);
2232 } else { 2235 } else {
2233 return null; 2236 return null;
2234 } 2237 }
2235 } 2238 }
2236 } 2239 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698