2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- // ignore_for_file: analyzer_use_new_elements
6
-
7
- import 'package:analyzer/dart/element/element.dart' ;
5
+ import 'package:analyzer/dart/element/element2.dart' ;
8
6
import 'package:analyzer/dart/element/nullability_suffix.dart' ;
9
7
import 'package:analyzer/dart/element/type.dart' ;
10
8
import 'package:analyzer/src/dart/element/type.dart' ;
@@ -584,93 +582,93 @@ class PromoteToNonNullTest extends AbstractTypeSystemTest {
584
582
}
585
583
586
584
test_typeParameter_bound_dynamic () {
587
- var element = typeParameter ('T' , bound: dynamicType);
585
+ var element = typeParameter2 ('T' , bound: dynamicType);
588
586
589
587
_checkTypeParameter (
590
- typeParameterTypeNone (element),
588
+ typeParameterTypeNone2 (element),
591
589
element: element,
592
590
promotedBound: null ,
593
591
);
594
592
}
595
593
596
594
test_typeParameter_bound_invalidType () {
597
- var element = typeParameter ('T' , bound: invalidType);
595
+ var element = typeParameter2 ('T' , bound: invalidType);
598
596
599
597
_checkTypeParameter (
600
- typeParameterTypeNone (element),
598
+ typeParameterTypeNone2 (element),
601
599
element: element,
602
600
promotedBound: null ,
603
601
);
604
602
}
605
603
606
604
test_typeParameter_bound_none () {
607
- var element = typeParameter ('T' , bound: intNone);
605
+ var element = typeParameter2 ('T' , bound: intNone);
608
606
609
607
_checkTypeParameter (
610
- typeParameterTypeNone (element),
608
+ typeParameterTypeNone2 (element),
611
609
element: element,
612
610
promotedBound: null ,
613
611
);
614
612
615
613
_checkTypeParameter (
616
- typeParameterTypeQuestion (element),
614
+ typeParameterTypeQuestion2 (element),
617
615
element: element,
618
616
promotedBound: null ,
619
617
);
620
618
}
621
619
622
620
test_typeParameter_bound_null () {
623
- var element = typeParameter ('T' );
621
+ var element = typeParameter2 ('T' );
624
622
_checkTypeParameter (
625
- typeParameterTypeNone (element),
623
+ typeParameterTypeNone2 (element),
626
624
element: element,
627
625
promotedBound: objectNone,
628
626
);
629
627
}
630
628
631
629
test_typeParameter_bound_question () {
632
- var element = typeParameter ('T' , bound: intQuestion);
630
+ var element = typeParameter2 ('T' , bound: intQuestion);
633
631
634
632
_checkTypeParameter (
635
- typeParameterTypeNone (element),
633
+ typeParameterTypeNone2 (element),
636
634
element: element,
637
635
promotedBound: intNone,
638
636
);
639
637
640
638
_checkTypeParameter (
641
- typeParameterTypeQuestion (element),
639
+ typeParameterTypeQuestion2 (element),
642
640
element: element,
643
641
promotedBound: intNone,
644
642
);
645
643
}
646
644
647
645
test_typeParameter_promotedBound_none () {
648
- var element = typeParameter ('T' , bound: numQuestion);
646
+ var element = typeParameter2 ('T' , bound: numQuestion);
649
647
650
648
_checkTypeParameter (
651
- promotedTypeParameterTypeNone (element, intNone),
649
+ promotedTypeParameterTypeNone2 (element, intNone),
652
650
element: element,
653
651
promotedBound: intNone,
654
652
);
655
653
656
654
_checkTypeParameter (
657
- promotedTypeParameterTypeQuestion (element, intNone),
655
+ promotedTypeParameterTypeQuestion2 (element, intNone),
658
656
element: element,
659
657
promotedBound: intNone,
660
658
);
661
659
}
662
660
663
661
test_typeParameter_promotedBound_question () {
664
- var element = typeParameter ('T' , bound: numQuestion);
662
+ var element = typeParameter2 ('T' , bound: numQuestion);
665
663
666
664
_checkTypeParameter (
667
- promotedTypeParameterTypeNone (element, intQuestion),
665
+ promotedTypeParameterTypeNone2 (element, intQuestion),
668
666
element: element,
669
667
promotedBound: intNone,
670
668
);
671
669
672
670
_checkTypeParameter (
673
- promotedTypeParameterTypeQuestion (element, intQuestion),
671
+ promotedTypeParameterTypeQuestion2 (element, intQuestion),
674
672
element: element,
675
673
promotedBound: intNone,
676
674
);
@@ -687,11 +685,11 @@ class PromoteToNonNullTest extends AbstractTypeSystemTest {
687
685
688
686
void _checkTypeParameter (
689
687
TypeParameterType type, {
690
- required TypeParameterElement element,
688
+ required TypeParameterElement2 element,
691
689
required DartType ? promotedBound,
692
690
}) {
693
691
var actual = typeSystem.promoteToNonNull (type) as TypeParameterTypeImpl ;
694
- expect (actual.element , same (element));
692
+ expect (actual.element3 , same (element));
695
693
expect (actual.promotedBound, promotedBound);
696
694
expect (actual.nullabilitySuffix, NullabilitySuffix .none);
697
695
}
0 commit comments