22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
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' ;
86import 'package:analyzer/dart/element/nullability_suffix.dart' ;
97import 'package:analyzer/dart/element/type.dart' ;
108import 'package:analyzer/src/dart/element/type.dart' ;
@@ -584,93 +582,93 @@ class PromoteToNonNullTest extends AbstractTypeSystemTest {
584582 }
585583
586584 test_typeParameter_bound_dynamic () {
587- var element = typeParameter ('T' , bound: dynamicType);
585+ var element = typeParameter2 ('T' , bound: dynamicType);
588586
589587 _checkTypeParameter (
590- typeParameterTypeNone (element),
588+ typeParameterTypeNone2 (element),
591589 element: element,
592590 promotedBound: null ,
593591 );
594592 }
595593
596594 test_typeParameter_bound_invalidType () {
597- var element = typeParameter ('T' , bound: invalidType);
595+ var element = typeParameter2 ('T' , bound: invalidType);
598596
599597 _checkTypeParameter (
600- typeParameterTypeNone (element),
598+ typeParameterTypeNone2 (element),
601599 element: element,
602600 promotedBound: null ,
603601 );
604602 }
605603
606604 test_typeParameter_bound_none () {
607- var element = typeParameter ('T' , bound: intNone);
605+ var element = typeParameter2 ('T' , bound: intNone);
608606
609607 _checkTypeParameter (
610- typeParameterTypeNone (element),
608+ typeParameterTypeNone2 (element),
611609 element: element,
612610 promotedBound: null ,
613611 );
614612
615613 _checkTypeParameter (
616- typeParameterTypeQuestion (element),
614+ typeParameterTypeQuestion2 (element),
617615 element: element,
618616 promotedBound: null ,
619617 );
620618 }
621619
622620 test_typeParameter_bound_null () {
623- var element = typeParameter ('T' );
621+ var element = typeParameter2 ('T' );
624622 _checkTypeParameter (
625- typeParameterTypeNone (element),
623+ typeParameterTypeNone2 (element),
626624 element: element,
627625 promotedBound: objectNone,
628626 );
629627 }
630628
631629 test_typeParameter_bound_question () {
632- var element = typeParameter ('T' , bound: intQuestion);
630+ var element = typeParameter2 ('T' , bound: intQuestion);
633631
634632 _checkTypeParameter (
635- typeParameterTypeNone (element),
633+ typeParameterTypeNone2 (element),
636634 element: element,
637635 promotedBound: intNone,
638636 );
639637
640638 _checkTypeParameter (
641- typeParameterTypeQuestion (element),
639+ typeParameterTypeQuestion2 (element),
642640 element: element,
643641 promotedBound: intNone,
644642 );
645643 }
646644
647645 test_typeParameter_promotedBound_none () {
648- var element = typeParameter ('T' , bound: numQuestion);
646+ var element = typeParameter2 ('T' , bound: numQuestion);
649647
650648 _checkTypeParameter (
651- promotedTypeParameterTypeNone (element, intNone),
649+ promotedTypeParameterTypeNone2 (element, intNone),
652650 element: element,
653651 promotedBound: intNone,
654652 );
655653
656654 _checkTypeParameter (
657- promotedTypeParameterTypeQuestion (element, intNone),
655+ promotedTypeParameterTypeQuestion2 (element, intNone),
658656 element: element,
659657 promotedBound: intNone,
660658 );
661659 }
662660
663661 test_typeParameter_promotedBound_question () {
664- var element = typeParameter ('T' , bound: numQuestion);
662+ var element = typeParameter2 ('T' , bound: numQuestion);
665663
666664 _checkTypeParameter (
667- promotedTypeParameterTypeNone (element, intQuestion),
665+ promotedTypeParameterTypeNone2 (element, intQuestion),
668666 element: element,
669667 promotedBound: intNone,
670668 );
671669
672670 _checkTypeParameter (
673- promotedTypeParameterTypeQuestion (element, intQuestion),
671+ promotedTypeParameterTypeQuestion2 (element, intQuestion),
674672 element: element,
675673 promotedBound: intNone,
676674 );
@@ -687,11 +685,11 @@ class PromoteToNonNullTest extends AbstractTypeSystemTest {
687685
688686 void _checkTypeParameter (
689687 TypeParameterType type, {
690- required TypeParameterElement element,
688+ required TypeParameterElement2 element,
691689 required DartType ? promotedBound,
692690 }) {
693691 var actual = typeSystem.promoteToNonNull (type) as TypeParameterTypeImpl ;
694- expect (actual.element , same (element));
692+ expect (actual.element3 , same (element));
695693 expect (actual.promotedBound, promotedBound);
696694 expect (actual.nullabilitySuffix, NullabilitySuffix .none);
697695 }
0 commit comments