Skip to content

Commit 6f0fe71

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate src/dart/element/type_algebra.dart
Change-Id: I7d55d1a8f4d3e0a56621ed3e1261cf1c4d579203 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415481 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 0c5c166 commit 6f0fe71

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ class _SubstitutedTypeParameters {
17431743

17441744
// Create type formals with specialized bounds.
17451745
// For example `<U extends T>` where T comes from an outer scope.
1746-
var newElements = <TypeParameterElement>[];
1746+
var newElements = <TypeParameterElementImpl>[];
17471747
var newTypes = <TypeParameterType>[];
17481748
for (int i = 0; i < elements.length; i++) {
17491749
var element = elements[i];
@@ -1757,10 +1757,11 @@ class _SubstitutedTypeParameters {
17571757
}
17581758

17591759
// Update bounds to reference new TypeParameterElement(s).
1760-
var substitution2 = Substitution.fromPairs(elements, newTypes);
1760+
// TODO(scheglov): remove the cast
1761+
var substitution2 = Substitution.fromPairs(elements.cast(), newTypes);
17611762
for (int i = 0; i < newElements.length; i++) {
17621763
var element = elements[i];
1763-
var newElement = newElements[i] as TypeParameterElementImpl;
1764+
var newElement = newElements[i];
17641765
var bound = element.bound;
17651766
if (bound != null) {
17661767
var newBound = substitution2.substituteType(bound);

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
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';
85
import 'package:analyzer/dart/element/element2.dart';
96
import 'package:analyzer/dart/element/nullability_suffix.dart';
107
import 'package:analyzer/dart/element/type.dart';
@@ -204,7 +201,7 @@ abstract class Substitution {
204201
/// Substitutes the Nth parameter in [parameters] with the Nth type in
205202
/// [types].
206203
static MapSubstitution fromPairs(
207-
List<TypeParameterElement> parameters,
204+
List<TypeParameterElementImpl> parameters,
208205
List<DartType> types,
209206
) {
210207
return fromPairs2(parameters.map((p) => p.asElement2).toFixedList(), types);

0 commit comments

Comments
 (0)