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

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

Issue 1713083002: Fix inconsistency with LinkedReference.numTypeParameters (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 serialization.elements; 5 library serialization.elements;
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/dart/element/element.dart'; 9 import 'package:analyzer/src/dart/element/element.dart';
10 import 'package:analyzer/src/dart/element/member.dart'; 10 import 'package:analyzer/src/dart/element/member.dart';
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 int index; 1030 int index;
1031 LinkedReferenceBuilder linkedReference; 1031 LinkedReferenceBuilder linkedReference;
1032 if (linked) { 1032 if (linked) {
1033 linkedReference = 1033 linkedReference =
1034 new LinkedReferenceBuilder(kind: kind, unit: unit, name: name); 1034 new LinkedReferenceBuilder(kind: kind, unit: unit, name: name);
1035 if (enclosingElement != null && 1035 if (enclosingElement != null &&
1036 enclosingElement is! CompilationUnitElement) { 1036 enclosingElement is! CompilationUnitElement) {
1037 linkedReference.containingReference = 1037 linkedReference.containingReference =
1038 _getElementReferenceId(enclosingElement, linked: linked); 1038 _getElementReferenceId(enclosingElement, linked: linked);
1039 if (enclosingElement is ClassElement) { 1039 if (enclosingElement is ClassElement) {
1040 linkedReference.numTypeParameters = 1040 // Nothing to do.
1041 enclosingElement.typeParameters.length;
1042 } else if (enclosingElement is ExecutableElement) { 1041 } else if (enclosingElement is ExecutableElement) {
1043 if (element is FunctionElement) { 1042 if (element is FunctionElement) {
1044 assert(enclosingElement.functions.contains(element)); 1043 assert(enclosingElement.functions.contains(element));
1045 linkedReference.localIndex = 1044 linkedReference.localIndex =
1046 enclosingElement.functions.indexOf(element); 1045 enclosingElement.functions.indexOf(element);
1047 } else if (element is LocalVariableElement) { 1046 } else if (element is LocalVariableElement) {
1048 assert(enclosingElement.localVariables.contains(element)); 1047 assert(enclosingElement.localVariables.contains(element));
1049 linkedReference.localIndex = 1048 linkedReference.localIndex =
1050 enclosingElement.localVariables.indexOf(element); 1049 enclosingElement.localVariables.indexOf(element);
1051 } else { 1050 } else {
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 exportNames.add(new LinkedExportNameBuilder( 1427 exportNames.add(new LinkedExportNameBuilder(
1429 name: name, 1428 name: name,
1430 dependency: serializeDependency(dependentLibrary), 1429 dependency: serializeDependency(dependentLibrary),
1431 unit: unit, 1430 unit: unit,
1432 kind: kind)); 1431 kind: kind));
1433 } 1432 }
1434 pb.exportNames = exportNames; 1433 pb.exportNames = exportNames;
1435 return pb; 1434 return pb;
1436 } 1435 }
1437 } 1436 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698