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

Side by Side Diff: pkg/analyzer/lib/src/dart/analysis/index.dart

Issue 2537883002: Don't attempt to record reference to a named parameter of a synthetic function. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/index_test.dart » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/dart/ast/token.dart'; 6 import 'package:analyzer/dart/ast/token.dart';
7 import 'package:analyzer/dart/ast/visitor.dart'; 7 import 'package:analyzer/dart/ast/visitor.dart';
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 import 'package:analyzer/dart/element/type.dart'; 9 import 'package:analyzer/dart/element/type.dart';
10 import 'package:analyzer/src/dart/element/member.dart'; 10 import 'package:analyzer/src/dart/element/member.dart';
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 elementKind == ElementKind.TYPE_PARAMETER || 433 elementKind == ElementKind.TYPE_PARAMETER ||
434 elementKind == ElementKind.FUNCTION && 434 elementKind == ElementKind.FUNCTION &&
435 element is FunctionElement && 435 element is FunctionElement &&
436 element.enclosingElement is ExecutableElement || 436 element.enclosingElement is ExecutableElement ||
437 elementKind == ElementKind.PARAMETER && 437 elementKind == ElementKind.PARAMETER &&
438 element is ParameterElement && 438 element is ParameterElement &&
439 element.parameterKind != ParameterKind.NAMED || 439 element.parameterKind != ParameterKind.NAMED ||
440 false) { 440 false) {
441 return; 441 return;
442 } 442 }
443 // Ignore named parameters of synthetic functions, e.g. created for LUB.
444 // These functions are not bound to a source, we cannot index them.
445 if (elementKind == ElementKind.PARAMETER &&
446 element is ParameterElement &&
447 element.enclosingElement.isSynthetic) {
448 return;
449 }
443 // Add the relation. 450 // Add the relation.
444 assembler.addElementRelation(element, kind, offset, length, isQualified); 451 assembler.addElementRelation(element, kind, offset, length, isQualified);
445 } 452 }
446 453
447 /** 454 /**
448 * Record that [element] has a relation of the given [kind] at the location 455 * Record that [element] has a relation of the given [kind] at the location
449 * of the given [token]. 456 * of the given [token].
450 */ 457 */
451 void recordRelationToken( 458 void recordRelationToken(
452 Element element, IndexRelationKind kind, Token token) { 459 Element element, IndexRelationKind kind, Token token) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 final String value; 799 final String value;
793 800
794 /** 801 /**
795 * The unique id of the string. It is set after indexing of the whole 802 * The unique id of the string. It is set after indexing of the whole
796 * package is done and we are assembling the full package index. 803 * package is done and we are assembling the full package index.
797 */ 804 */
798 int id; 805 int id;
799 806
800 _StringInfo(this.value); 807 _StringInfo(this.value);
801 } 808 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/dart/analysis/index_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698