@@ -539,6 +539,62 @@ void f(l.N? n) {
539
539
''' , matchFixMessage: "Hide others to use 'N' from 'lib1.dart' as l" );
540
540
}
541
541
542
+ Future <void > test_static_member () async {
543
+ newFile (join (testPackageLibPath, 'lib1.dart' ), '''
544
+ class N {}''' );
545
+ newFile (join (testPackageLibPath, 'lib2.dart' ), '''
546
+ class N {}''' );
547
+ await resolveTestCode ('''
548
+ import 'lib1.dart';
549
+ import 'lib2.dart';
550
+
551
+ void f() {
552
+ var _ = [N.new];
553
+ }
554
+ ''' );
555
+ await assertHasFix (
556
+ '''
557
+ import 'lib1.dart' hide N;
558
+ import 'lib2.dart';
559
+
560
+ void f() {
561
+ var _ = [N.new];
562
+ }
563
+ ''' ,
564
+ matchFixMessage: "Hide others to use 'N' from 'lib2.dart'" ,
565
+ errorFilter:
566
+ (error) => error.errorCode == CompileTimeErrorCode .AMBIGUOUS_IMPORT ,
567
+ );
568
+ }
569
+
570
+ Future <void > test_static_member_prefixed () async {
571
+ newFile (join (testPackageLibPath, 'lib1.dart' ), '''
572
+ class N {}''' );
573
+ newFile (join (testPackageLibPath, 'lib2.dart' ), '''
574
+ class N {}''' );
575
+ await resolveTestCode ('''
576
+ import 'lib1.dart' as l;
577
+ import 'lib2.dart' as l;
578
+
579
+ void f() {
580
+ var _ = [l.N.new];
581
+ }
582
+ ''' );
583
+ await assertHasFix (
584
+ '''
585
+ import 'lib1.dart' as l hide N;
586
+ import 'lib2.dart' as l;
587
+
588
+ void f() {
589
+ var _ = [l.N.new];
590
+ }
591
+ ''' ,
592
+ matchFixMessage: "Hide others to use 'N' from 'lib2.dart' as l" ,
593
+ errorFilter:
594
+ (error) => error.errorCode == CompileTimeErrorCode .AMBIGUOUS_IMPORT ,
595
+ );
596
+ }
597
+
542
598
Future <void > test_triple () async {
543
599
newFile (join (testPackageLibPath, 'lib1.dart' ), '''
544
600
export 'lib3.dart';''' );
0 commit comments