Skip to content

Commit 23246de

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove V1 getters from FunctionType.
Change-Id: Ic1d3b2d64c4b6b647c9134263d77479bf88b16c1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423365 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 638f015 commit 23246de

File tree

3 files changed

+19
-51
lines changed

3 files changed

+19
-51
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,12 +4155,7 @@ package:analyzer/dart/element/type.dart:
41554155
namedParameterTypes (getter: Map<String, DartType>)
41564156
normalParameterTypes (getter: List<DartType>)
41574157
optionalParameterTypes (getter: List<DartType>)
4158-
parameters (getter: List<ParameterElement>, deprecated)
4159-
positionalParameterTypes (getter: List<DartType>, deprecated)
4160-
requiredPositionalParameterCount (getter: int, deprecated)
41614158
returnType (getter: DartType)
4162-
sortedNamedParameters (getter: List<ParameterElement>, deprecated)
4163-
typeFormals (getter: List<TypeParameterElement>, deprecated)
41644159
typeParameters (getter: List<TypeParameterElement2>, experimental)
41654160
instantiate (method: FunctionType Function(List<DartType>))
41664161
InstantiatedTypeAliasElement (class extends Object):

pkg/analyzer/lib/dart/element/type.dart

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
/// the references to `String` and `int` are type arguments.
2222
library;
2323

24-
import 'package:analyzer/dart/element/element.dart';
2524
import 'package:analyzer/dart/element/element2.dart';
2625
import 'package:analyzer/dart/element/nullability_suffix.dart';
2726
import 'package:analyzer/dart/element/type_visitor.dart';
@@ -244,50 +243,9 @@ abstract class FunctionType implements DartType {
244243
/// optional parameters declared, then the map is empty.
245244
List<DartType> get optionalParameterTypes;
246245

247-
/// A list containing the parameters elements of this type of function.
248-
///
249-
/// The parameter types are not necessarily in the same order as they appear
250-
/// in the declaration of the function.
251-
@Deprecated('Use formalParameters instead')
252-
List<ParameterElement> get parameters;
253-
254-
/// All the positional parameter types, starting with the required ones, and
255-
/// followed by the optional ones.
256-
///
257-
/// Deprecated: this getter is a part of the analyzer's private
258-
/// implementation, and was exposed by accident (see
259-
/// https://github.com/dart-lang/sdk/issues/59763). Please use
260-
/// [normalParameterTypes] and [optionalParameterTypes] instead.
261-
@Deprecated('Please use normalParameterTypes and optionalParameterTypes')
262-
List<DartType> get positionalParameterTypes;
263-
264-
/// The number of elements of [positionalParameterTypes] that are required
265-
/// parameters.
266-
///
267-
/// Deprecated: this getter is a part of the analyzer's private
268-
/// implementation, and was exposed by accident (see
269-
/// https://github.com/dart-lang/sdk/issues/59763). Please use
270-
/// [normalParameterTypes].length instead.
271-
@Deprecated('Please use normalParameterTypes.length')
272-
int get requiredPositionalParameterCount;
273-
274246
/// The type of object returned by this type of function.
275247
DartType get returnType;
276248

277-
/// All the named parameters, sorted by name.
278-
///
279-
/// Deprecated: this getter is a part of the analyzer's private
280-
/// implementation, and was exposed by accident (see
281-
/// https://github.com/dart-lang/sdk/issues/59763). Please use [parameters]
282-
/// instead.
283-
@Deprecated('Please use parameters')
284-
List<ParameterElement> get sortedNamedParameters;
285-
286-
/// The formal type parameters of this generic function; for example,
287-
/// `<T> T -> T`.
288-
@Deprecated('Use typeParameters instead')
289-
List<TypeParameterElement> get typeFormals;
290-
291249
/// The type parameters.
292250
@experimental
293251
List<TypeParameterElement2> get typeParameters;

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,22 +88,37 @@ class FunctionTypeImpl extends TypeImpl
8888
@override
8989
final TypeImpl returnType;
9090

91-
@override
91+
/// The formal type parameters of this generic function; for example,
92+
/// `<T> T -> T`.
9293
final List<TypeParameterElementImpl> typeFormals;
9394

94-
@override
95+
/// A list containing the parameters elements of this type of function.
96+
///
97+
/// The parameter types are not necessarily in the same order as they appear
98+
/// in the declaration of the function.
9599
final List<ParameterElementMixin> parameters;
96100

97101
@override
98102
final NullabilitySuffix nullabilitySuffix;
99103

100-
@override
104+
/// All the positional parameter types, starting with the required ones, and
105+
/// followed by the optional ones.
106+
///
107+
/// Deprecated: this getter is a part of the analyzer's private
108+
/// implementation, and was exposed by accident (see
109+
/// https://github.com/dart-lang/sdk/issues/59763). Please use
110+
/// [normalParameterTypes] and [optionalParameterTypes] instead.
101111
final List<TypeImpl> positionalParameterTypes;
102112

103113
@override
104114
final int requiredPositionalParameterCount;
105115

106-
@override
116+
/// All the named parameters, sorted by name.
117+
///
118+
/// Deprecated: this getter is a part of the analyzer's private
119+
/// implementation, and was exposed by accident (see
120+
/// https://github.com/dart-lang/sdk/issues/59763). Please use [parameters]
121+
/// instead.
107122
final List<ParameterElementMixin> sortedNamedParameters;
108123

109124
factory FunctionTypeImpl({

0 commit comments

Comments
 (0)