File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
pkg/analyzer/lib/src/dart/element Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff 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);
Original file line number Diff line number Diff line change 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' ;
85import 'package:analyzer/dart/element/element2.dart' ;
96import 'package:analyzer/dart/element/nullability_suffix.dart' ;
107import '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);
You can’t perform that action at this time.
0 commit comments