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- import 'package:analyzer/dart/element/element .dart' ;
5+ import 'package:analyzer/dart/element/element2 .dart' ;
66import 'package:analyzer/dart/element/type.dart' ;
77import 'package:analyzer/src/dart/element/type_algebra.dart' ;
88import 'package:analyzer/src/dart/element/type_system.dart' ;
@@ -30,7 +30,7 @@ class TypeArgumentIssue {
3030 final int index;
3131
3232 /// The type parameter with the bound that was violated.
33- final TypeParameterElement parameter;
33+ final TypeParameterElement2 parameter;
3434
3535 /// The substituted bound of the [parameter] .
3636 final DartType parameterBound;
@@ -75,23 +75,23 @@ class TypeBoundedHelper {
7575 TypeBoundedResult _isRegularBounded (DartType type) {
7676 List <TypeArgumentIssue >? issues;
7777
78- String elementName;
79- List <TypeParameterElement > typeParameters;
78+ String ? elementName;
79+ List <TypeParameterElement2 > typeParameters;
8080 List <DartType > typeArguments;
8181 var alias = type.alias;
8282 if (alias != null ) {
83- elementName = alias.element.name ;
84- typeParameters = alias.element.typeParameters ;
83+ elementName = alias.element2.name3 ;
84+ typeParameters = alias.element2.typeParameters2 ;
8585 typeArguments = alias.typeArguments;
8686 } else if (type is InterfaceType ) {
87- elementName = type.element.name ;
88- typeParameters = type.element.typeParameters ;
87+ elementName = type.element3.name3 ;
88+ typeParameters = type.element3.typeParameters2 ;
8989 typeArguments = type.typeArguments;
9090 } else {
9191 return const RegularBoundedTypeResult ._();
9292 }
9393
94- var substitution = Substitution .fromPairs (typeParameters, typeArguments);
94+ var substitution = Substitution .fromPairs2 (typeParameters, typeArguments);
9595 for (var i = 0 ; i < typeParameters.length; i++ ) {
9696 var typeParameter = typeParameters[i];
9797 var typeArgument = typeArguments[i];
@@ -111,7 +111,7 @@ class TypeBoundedHelper {
111111 }
112112 }
113113
114- if (issues == null ) {
114+ if (issues == null || elementName == null ) {
115115 return const RegularBoundedTypeResult ._();
116116 } else {
117117 return NotWellBoundedTypeResult ._(
0 commit comments