File tree Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Expand file tree Collapse file tree 2 files changed +40
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ class LinkingBundleContext {
51
51
52
52
int indexOfElement (Element element) {
53
53
if (element == null ) return 0 ;
54
+ if (element is MultiplyDefinedElement ) return 0 ;
54
55
assert (element is ! Member );
55
56
56
57
if (identical (element, DynamicElementImpl .instance)) {
Original file line number Diff line number Diff line change @@ -10867,12 +10867,48 @@ class C {
10867
10867
10868
10868
test_unresolved_annotation_simpleIdentifier () async {
10869
10869
var library = await checkLibrary ('@foo class C {}' , allowErrors: true );
10870
- checkElementText (library, r'''
10871
- @
10872
- foo/*location: null*/
10870
+ checkElementText (
10871
+ library,
10872
+ r'''
10873
10873
class C {
10874
10874
}
10875
+ metadata
10876
+ Annotation
10877
+ element: <null>
10878
+ name: SimpleIdentifier
10879
+ staticElement: <null>
10880
+ staticType: dynamic
10881
+ token: foo
10882
+ ''' ,
10883
+ withFullyResolvedAst: true );
10884
+ }
10885
+
10886
+ test_unresolved_annotation_simpleIdentifier_multiplyDefined () async {
10887
+ addLibrarySource ('/a.dart' , 'const v = 0;' );
10888
+ addLibrarySource ('/b.dart' , 'const v = 0;' );
10889
+ var library = await checkLibrary ('''
10890
+ import 'a.dart';
10891
+ import 'b.dart';
10892
+
10893
+ @v
10894
+ class C {}
10875
10895
''' );
10896
+ checkElementText (
10897
+ library,
10898
+ r'''
10899
+ import 'a.dart';
10900
+ import 'b.dart';
10901
+ class C {
10902
+ }
10903
+ metadata
10904
+ Annotation
10905
+ element: <null>
10906
+ name: SimpleIdentifier
10907
+ staticElement: <null>
10908
+ staticType: dynamic
10909
+ token: v
10910
+ ''' ,
10911
+ withFullyResolvedAst: true );
10876
10912
}
10877
10913
10878
10914
test_unresolved_annotation_unnamedConstructorCall_noClass () async {
You can’t perform that action at this time.
0 commit comments