mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +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
|
@ -426,6 +426,7 @@ class _IndexContributor extends GeneralizingAstVisitor {
|
|||
ElementKind elementKind = element?.kind;
|
||||
if (elementKind == null ||
|
||||
elementKind == ElementKind.DYNAMIC ||
|
||||
elementKind == ElementKind.ERROR ||
|
||||
elementKind == ElementKind.LABEL ||
|
||||
elementKind == ElementKind.LOCAL_VARIABLE ||
|
||||
elementKind == ElementKind.PREFIX ||
|
||||
|
|
|
@ -793,6 +793,16 @@ class A {
|
|||
..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 {
|
||||
await _indexTestUnit('''
|
||||
foo({var p}) {}
|
||||
|
|
Loading…
Reference in a new issue