Skip to content

Commit 53ca98c

Browse files
pqCommit Queue
authored andcommitted
[element model] migrate well_bounded
Change-Id: I27e1d7668571ffc2401b247c501092f5e065ced9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399980 Reviewed-by: Brian Wilkerson <[email protected]> Auto-Submit: Phil Quitslund <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent b08eb9d commit 53ca98c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

pkg/analyzer/analyzer_use_new_elements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ lib/src/dart/element/type_provider.dart
5656
lib/src/dart/element/type_schema.dart
5757
lib/src/dart/element/type_system.dart
5858
lib/src/dart/element/type_visitor.dart
59-
lib/src/dart/element/well_bounded.dart
6059
lib/src/dart/micro/analysis_context.dart
6160
lib/src/dart/micro/resolve_file.dart
6261
lib/src/dart/micro/utils.dart

pkg/analyzer/lib/src/dart/element/well_bounded.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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';
66
import 'package:analyzer/dart/element/type.dart';
77
import 'package:analyzer/src/dart/element/type_algebra.dart';
88
import '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

Comments
 (0)