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

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

Issue 1531913002: Add UnlinkedClass.hasNoSupertype property to summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
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 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/element_handle.dart'; 9 import 'package:analyzer/src/generated/element_handle.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 for (int i = 0; i < serializedClass.typeParameters.length; i++) { 243 for (int i = 0; i < serializedClass.typeParameters.length; i++) {
244 finishTypeParameter( 244 finishTypeParameter(
245 serializedClass.typeParameters[i], currentTypeParameters[i]); 245 serializedClass.typeParameters[i], currentTypeParameters[i]);
246 } 246 }
247 ClassElementImpl classElement = 247 ClassElementImpl classElement =
248 new ClassElementImpl(serializedClass.name, -1); 248 new ClassElementImpl(serializedClass.name, -1);
249 classElement.mixinApplication = serializedClass.isMixinApplication; 249 classElement.mixinApplication = serializedClass.isMixinApplication;
250 InterfaceTypeImpl correspondingType = new InterfaceTypeImpl(classElement); 250 InterfaceTypeImpl correspondingType = new InterfaceTypeImpl(classElement);
251 if (serializedClass.supertype != null) { 251 if (serializedClass.supertype != null) {
252 classElement.supertype = buildType(serializedClass.supertype); 252 classElement.supertype = buildType(serializedClass.supertype);
253 } else { 253 } else if (!serializedClass.hasNoSupertype) {
254 // TODO(paulberry): don't make Object point to itself.
255 classElement.supertype = summaryResynthesizer.typeProvider.objectType; 254 classElement.supertype = summaryResynthesizer.typeProvider.objectType;
256 } 255 }
257 classElement.interfaces = 256 classElement.interfaces =
258 serializedClass.interfaces.map(buildType).toList(); 257 serializedClass.interfaces.map(buildType).toList();
259 classElement.mixins = serializedClass.mixins.map(buildType).toList(); 258 classElement.mixins = serializedClass.mixins.map(buildType).toList();
260 classElement.typeParameters = currentTypeParameters; 259 classElement.typeParameters = currentTypeParameters;
261 ElementHolder memberHolder = new ElementHolder(); 260 ElementHolder memberHolder = new ElementHolder();
262 bool constructorFound = false; 261 bool constructorFound = false;
263 for (UnlinkedExecutable serializedExecutable 262 for (UnlinkedExecutable serializedExecutable
264 in serializedClass.executables) { 263 in serializedClass.executables) {
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 elementMap[cls.name] = cls; 917 elementMap[cls.name] = cls;
919 } 918 }
920 for (FunctionTypeAliasElement typeAlias in unit.functionTypeAliases) { 919 for (FunctionTypeAliasElement typeAlias in unit.functionTypeAliases) {
921 elementMap[typeAlias.name] = typeAlias; 920 elementMap[typeAlias.name] = typeAlias;
922 } 921 }
923 resummarizedElements[absoluteUri] = elementMap; 922 resummarizedElements[absoluteUri] = elementMap;
924 unitHolder = null; 923 unitHolder = null;
925 prelinkedUnit = null; 924 prelinkedUnit = null;
926 } 925 }
927 } 926 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/lib/src/summary/summarize_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698