File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
pkg/analyzer/lib/src/dart/element Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1550,6 +1550,10 @@ abstract class TypeImpl implements DartType, SharedType {
15501550 /// Initialize a newly created type.
15511551 const TypeImpl ({this .alias});
15521552
1553+ // TODO(scheglov): remove it after element model migration.
1554+ @override
1555+ Element ? get element => element3? .asElement;
1556+
15531557 @override
15541558 TypeImpl get extensionTypeErasure {
15551559 return const ExtensionTypeErasure ().perform (this );
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-
75import 'package:_fe_analyzer_shared/src/types/shared_type.dart' ;
86import 'package:analyzer/dart/ast/token.dart' show Keyword;
9- import 'package:analyzer/dart/element/element.dart' ;
107import 'package:analyzer/dart/element/element2.dart' ;
118import 'package:analyzer/dart/element/nullability_suffix.dart' ;
129import 'package:analyzer/dart/element/type.dart' ;
@@ -26,9 +23,6 @@ class UnknownInferredType extends TypeImpl implements SharedUnknownType {
2623
2724 const UnknownInferredType ._();
2825
29- @override
30- Element ? get element => null ;
31-
3226 @override
3327 Element2 ? get element3 => null ;
3428
@@ -91,7 +85,13 @@ class UnknownInferredType extends TypeImpl implements SharedUnknownType {
9185
9286 if (type is FunctionType ) {
9387 return isUnknown (type.returnType) ||
94- type.parameters.any ((p) => isUnknown (p.type));
88+ type.typeParameters.any ((typeParameter) {
89+ var bound = typeParameter.bound;
90+ return bound != null && isUnknown (bound);
91+ }) ||
92+ type.formalParameters.any ((formalParameter) {
93+ return isUnknown (formalParameter.type);
94+ });
9595 }
9696
9797 if (type is RecordType ) {
You can’t perform that action at this time.
0 commit comments