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

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

Issue 2529433003: Fix for exception duirng indexing a reference to MultiplyDefinedElement. (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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 * [offset] and [length]. The flag [isQualified] is `true` if the relation 419 * [offset] and [length]. The flag [isQualified] is `true` if the relation
420 * has an explicit or implicit qualifier, so [element] cannot be shadowed by 420 * has an explicit or implicit qualifier, so [element] cannot be shadowed by
421 * a local declaration. 421 * a local declaration.
422 */ 422 */
423 void recordRelationOffset(Element element, IndexRelationKind kind, int offset, 423 void recordRelationOffset(Element element, IndexRelationKind kind, int offset,
424 int length, bool isQualified) { 424 int length, bool isQualified) {
425 // Ignore elements that can't be referenced outside of the unit. 425 // Ignore elements that can't be referenced outside of the unit.
426 ElementKind elementKind = element?.kind; 426 ElementKind elementKind = element?.kind;
427 if (elementKind == null || 427 if (elementKind == null ||
428 elementKind == ElementKind.DYNAMIC || 428 elementKind == ElementKind.DYNAMIC ||
429 elementKind == ElementKind.ERROR ||
429 elementKind == ElementKind.LABEL || 430 elementKind == ElementKind.LABEL ||
430 elementKind == ElementKind.LOCAL_VARIABLE || 431 elementKind == ElementKind.LOCAL_VARIABLE ||
431 elementKind == ElementKind.PREFIX || 432 elementKind == ElementKind.PREFIX ||
432 elementKind == ElementKind.TYPE_PARAMETER || 433 elementKind == ElementKind.TYPE_PARAMETER ||
433 elementKind == ElementKind.FUNCTION && 434 elementKind == ElementKind.FUNCTION &&
434 element is FunctionElement && 435 element is FunctionElement &&
435 element.enclosingElement is ExecutableElement || 436 element.enclosingElement is ExecutableElement ||
436 elementKind == ElementKind.PARAMETER && 437 elementKind == ElementKind.PARAMETER &&
437 element is ParameterElement && 438 element is ParameterElement &&
438 element.parameterKind != ParameterKind.NAMED || 439 element.parameterKind != ParameterKind.NAMED ||
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 final String value; 792 final String value;
792 793
793 /** 794 /**
794 * The unique id of the string. It is set after indexing of the whole 795 * The unique id of the string. It is set after indexing of the whole
795 * package is done and we are assembling the full package index. 796 * package is done and we are assembling the full package index.
796 */ 797 */
797 int id; 798 int id;
798 799
799 _StringInfo(this.value); 800 _StringInfo(this.value);
800 } 801 }
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