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

Side by Side Diff: pkg/analyzer/lib/src/summary/resynthesize.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 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 2027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 locationComponents = 2038 locationComponents =
2039 enclosingInfo.element.location.components.toList(); 2039 enclosingInfo.element.location.components.toList();
2040 locationComponents.add(identifier); 2040 locationComponents.add(identifier);
2041 } else { 2041 } else {
2042 String identifier = _getElementIdentifier(name, linkedReference.kind); 2042 String identifier = _getElementIdentifier(name, linkedReference.kind);
2043 locationComponents = getReferencedLocationComponents( 2043 locationComponents = getReferencedLocationComponents(
2044 linkedReference.dependency, linkedReference.unit, identifier); 2044 linkedReference.dependency, linkedReference.unit, identifier);
2045 } 2045 }
2046 ElementLocation location = 2046 ElementLocation location =
2047 new ElementLocationImpl.con3(locationComponents); 2047 new ElementLocationImpl.con3(locationComponents);
2048 if (enclosingInfo != null) {
2049 numTypeParameters += enclosingInfo.numTypeParameters;
2050 }
2048 switch (linkedReference.kind) { 2051 switch (linkedReference.kind) {
2049 case ReferenceKind.classOrEnum: 2052 case ReferenceKind.classOrEnum:
2050 element = new ClassElementHandle(summaryResynthesizer, location); 2053 element = new ClassElementHandle(summaryResynthesizer, location);
2051 break; 2054 break;
2052 case ReferenceKind.constructor: 2055 case ReferenceKind.constructor:
2053 assert(location.components.length == 4); 2056 assert(location.components.length == 4);
2054 element = 2057 element =
2055 new ConstructorElementHandle(summaryResynthesizer, location); 2058 new ConstructorElementHandle(summaryResynthesizer, location);
2056 numTypeParameters = enclosingInfo.numTypeParameters;
2057 break; 2059 break;
2058 case ReferenceKind.length: 2060 case ReferenceKind.length:
2059 element = _buildStringLengthPropertyAccessorElement(); 2061 element = _buildStringLengthPropertyAccessorElement();
2060 break; 2062 break;
2061 case ReferenceKind.method: 2063 case ReferenceKind.method:
2062 assert(location.components.length == 4); 2064 assert(location.components.length == 4);
2063 element = new MethodElementHandle(summaryResynthesizer, location); 2065 element = new MethodElementHandle(summaryResynthesizer, location);
2064 break; 2066 break;
2065 case ReferenceKind.propertyAccessor: 2067 case ReferenceKind.propertyAccessor:
2066 assert(location.components.length == 4); 2068 assert(location.components.length == 4);
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 } 2384 }
2383 : () => this.element; 2385 : () => this.element;
2384 // TODO(paulberry): Is it a bug that we have to pass `false` for 2386 // TODO(paulberry): Is it a bug that we have to pass `false` for
2385 // isInstantiated? 2387 // isInstantiated?
2386 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false); 2388 return new DeferredFunctionTypeImpl(computer, null, typeArguments, false);
2387 } else { 2389 } else {
2388 return null; 2390 return null;
2389 } 2391 }
2390 } 2392 }
2391 } 2393 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.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