Skip to content

Commit

Permalink
Version 3.7.0-285.0.dev
Browse files Browse the repository at this point in the history
Merge 61f1d69 into dev
  • Loading branch information
Dart CI committed Dec 25, 2024
2 parents ed6b041 + 61f1d69 commit bf2cf87
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
37 changes: 30 additions & 7 deletions pkg/analyzer/lib/dart/element/type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,7 @@ abstract class DynamicType implements DartType {}
/// T<sub>xk</sub> xk}) &rarr; T</i>.
///
/// Clients may not extend, implement or mix-in this class.
abstract class FunctionType
implements
DartType,
SharedFunctionTypeStructure<DartType, TypeParameterElement,
ParameterElement> {
abstract class FunctionType implements DartType {
@override
Null get element;

Expand Down Expand Up @@ -268,18 +264,45 @@ abstract class FunctionType
/// in the declaration of the function.
List<ParameterElement> get parameters;

/// All the positional parameter types, starting with the required ones, and
/// followed by the optional ones.
///
/// Deprecated: this getter is a part of the analyzer's private
/// implementation, and was exposed by accident (see
/// https://github.com/dart-lang/sdk/issues/59763). Please use
/// [normalParameterTypes] and [optionalParameterTypes] instead.
@Deprecated('Please use normalParameterTypes and optionalParameterTypes')
List<DartType> get positionalParameterTypes;

/// The number of elements of [positionalParameterTypes] that are required
/// parameters.
///
/// Deprecated: this getter is a part of the analyzer's private
/// implementation, and was exposed by accident (see
/// https://github.com/dart-lang/sdk/issues/59763). Please use
/// [normalParameterTypes].length instead.
@Deprecated('Please use normalParameterTypes.length')
int get requiredPositionalParameterCount;

/// The type of object returned by this type of function.
@override
DartType get returnType;

/// All the named parameters, sorted by name.
///
/// Deprecated: this getter is a part of the analyzer's private
/// implementation, and was exposed by accident (see
/// https://github.com/dart-lang/sdk/issues/59763). Please use [parameters]
/// instead.
@Deprecated('Please use parameters')
List<ParameterElement> get sortedNamedParameters;

/// The formal type parameters of this generic function; for example,
/// `<T> T -> T`.
//
// TODO(scheglov): Remove the mention for "typeParameters".
// These are distinct from the `typeParameters` list, which contains type
// parameters from surrounding contexts, and thus are free type variables
// from the perspective of this function type.
@override
List<TypeParameterElement> get typeFormals;

/// The type parameters.
Expand Down
6 changes: 5 additions & 1 deletion pkg/analyzer/lib/src/dart/element/type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ class DynamicTypeImpl extends TypeImpl
}

/// The type of a function, method, constructor, getter, or setter.
class FunctionTypeImpl extends TypeImpl implements FunctionType {
class FunctionTypeImpl extends TypeImpl
implements
FunctionType,
SharedFunctionTypeStructure<DartType, TypeParameterElement,
ParameterElement> {
@override
late int hashCode = _computeHashCode();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/dart/element/type_algebra.dart';
import 'package:analyzer/src/dart/element/type_schema.dart';
import 'package:analyzer/src/dart/resolver/flow_analysis_visitor.dart';
Expand Down Expand Up @@ -226,7 +227,7 @@ class TypeConstraintGatherer extends shared.TypeConstraintGenerator<
@override
(DartType, DartType, {List<TypeParameterElement> typeParametersToEliminate})
instantiateFunctionTypesAndProvideFreshTypeParameters(
covariant FunctionType P, covariant FunctionType Q,
covariant FunctionTypeImpl P, covariant FunctionTypeImpl Q,
{required bool leftSchema}) {
// And `Z0...Zn` are fresh variables with bounds `B20, ..., B2n`.
// Where `B2i` is `B0i[Z0/T0, ..., Zn/Tn]` if `P` is a type schema.
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 7
PATCH 0
PRERELEASE 284
PRERELEASE 285
PRERELEASE_PATCH 0

0 comments on commit bf2cf87

Please sign in to comment.