mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 14:32:24 +00:00
Fix for exception duirng indexing a reference to MultiplyDefinedElement.
R=brianwilkerson@google.com, paulberry@google.com BUG= Review URL: https://codereview.chromium.org/2529433003 .
This commit is contained in:
parent
ea94a5dcb0
commit
7ec65fb9ca
2 changed files with 11 additions and 0 deletions
|
@ -426,6 +426,7 @@ class _IndexContributor extends GeneralizingAstVisitor {
|
||||||
ElementKind elementKind = element?.kind;
|
ElementKind elementKind = element?.kind;
|
||||||
if (elementKind == null ||
|
if (elementKind == null ||
|
||||||
elementKind == ElementKind.DYNAMIC ||
|
elementKind == ElementKind.DYNAMIC ||
|
||||||
|
elementKind == ElementKind.ERROR ||
|
||||||
elementKind == ElementKind.LABEL ||
|
elementKind == ElementKind.LABEL ||
|
||||||
elementKind == ElementKind.LOCAL_VARIABLE ||
|
elementKind == ElementKind.LOCAL_VARIABLE ||
|
||||||
elementKind == ElementKind.PREFIX ||
|
elementKind == ElementKind.PREFIX ||
|
||||||
|
|
|
@ -793,6 +793,16 @@ class A {
|
||||||
..isReferencedAt('method); // nq', false);
|
..isReferencedAt('method); // nq', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_isReferencedBy_MultiplyDefinedElement() async {
|
||||||
|
provider.newFile(_p('$testProject/a1.dart'), 'class A {}');
|
||||||
|
provider.newFile(_p('$testProject/a2.dart'), 'class A {}');
|
||||||
|
await _indexTestUnit('''
|
||||||
|
import 'a1.dart';
|
||||||
|
import 'a2.dart';
|
||||||
|
A v = null;
|
||||||
|
''');
|
||||||
|
}
|
||||||
|
|
||||||
test_isReferencedBy_ParameterElement() async {
|
test_isReferencedBy_ParameterElement() async {
|
||||||
await _indexTestUnit('''
|
await _indexTestUnit('''
|
||||||
foo({var p}) {}
|
foo({var p}) {}
|
||||||
|
|
Loading…
Reference in a new issue