Skip to content

Commit

Permalink
Version 3.7.0-46.0.dev
Browse files Browse the repository at this point in the history
Merge 49c5541 into dev
  • Loading branch information
Dart CI committed Oct 21, 2024
2 parents c865968 + 49c5541 commit 10387c3
Show file tree
Hide file tree
Showing 133 changed files with 3,659 additions and 2,240 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ vars = {
"path_rev": "e969f42ed112dd702a9453beb9df6c12ae2d3805",
"pool_rev": "7bfc71b39742753a88688e56e55a828a2f5dc0bf",
"protobuf_rev": "ccf104dbc36929c0f8708285d5f3a8fae206343e",
"pub_rev": "1efd3f5e274e153637d99698b0ee454f6f2550ab", # disable tools/rev_sdk_deps.dart
"pub_rev": "1d7b0d9a35be9cff5d071f6cf17fcdcde2b7ecc5", # disable tools/rev_sdk_deps.dart
"pub_semver_rev": "8cce9d00431b6653026cdfcf6cf8548078c56f02",
"shelf_rev": "f5600534e3e49ebed02e1e14ec82553958d86f36",
"source_maps_rev": "17695e81d9ad129d20effd3d5c4f1cfa03f5add8",
Expand Down
228 changes: 115 additions & 113 deletions pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/_fe_analyzer_shared/lib/src/parser/stack_listener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ enum NullValues implements NullValue<Object> {
Modifiers,
Name,
NominalVariable,
NominalVariables,
NominalParameters,
OperatorList,
ParameterDefaultValue,
Pattern,
Expand All @@ -79,7 +79,7 @@ enum NullValues implements NullValue<Object> {
RecordTypeFieldList,
ShowClause,
StringLiteral,
StructuralVariables,
StructuralParameters,
Token,
Type,
TypeArguments,
Expand Down Expand Up @@ -265,7 +265,7 @@ abstract class StackListener extends Listener with StackChecker {
@override
void handleNoTypeVariables(Token token) {
debugEvent("NoTypeVariables");
push(NullValues.NominalVariables);
push(NullValues.NominalParameters);
}

@override
Expand Down
2 changes: 1 addition & 1 deletion pkg/_js_interop_checks/lib/js_interop_checks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ class JsInteropChecks extends RecursiveVisitor {
bool _isAllowedExternalType(DartType type) {
if (type is VoidType || type is NullType) return true;
if (type is TypeParameterType || type is StructuralParameterType) {
final bound = type.nonTypeVariableBound;
final bound = type.nonTypeParameterBound;
// If it can be used as a representation type of an interop extension
// type, it is okay to be used as a bound.
// TODO(srujzs): We may want to support type parameters with primitive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ class ExtensionIndex {
} else if (type is ExtensionType) {
return isInteropExtensionType(type.extensionTypeDeclaration);
} else if (type is TypeParameterType || type is StructuralParameterType) {
return isStaticInteropType(type.nonTypeVariableBound);
return isStaticInteropType(type.nonTypeParameterBound);
}
return false;
}
Expand All @@ -1156,7 +1156,7 @@ class ExtensionIndex {
return true;
}
} else if (type is TypeParameterType || type is StructuralParameterType) {
return isExternalDartReferenceType(type.nonTypeVariableBound);
return isExternalDartReferenceType(type.nonTypeParameterBound);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,13 @@ class StaticInteropMockValidator {
class TypeParameterResolver extends ReplacementVisitor {
@override
DartType? visitTypeParameterType(TypeParameterType node, Variance variance) {
return node.nonTypeVariableBound;
return node.nonTypeParameterBound;
}

@override
DartType? visitStructuralParameterType(
StructuralParameterType node, Variance variance) {
return node.nonTypeVariableBound;
return node.nonTypeParameterBound;
}

DartType resolve(DartType node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,8 @@ LintCode.omit_local_variable_types:
status: hasFix
LintCode.omit_obvious_local_variable_types:
status: hasFix
LintCode.omit_obvious_property_types:
status: needsEvaluation
LintCode.one_member_abstracts:
status: noFix
notes: |-
Expand Down Expand Up @@ -2359,6 +2361,8 @@ LintCode.sort_unnamed_constructors_first:
status: hasFix
LintCode.specify_nonobvious_local_variable_types:
status: hasFix
LintCode.specify_nonobvious_property_types:
status: needsEvaluation
LintCode.test_types_in_equals:
status: noFix
LintCode.throw_in_finally:
Expand Down
8 changes: 4 additions & 4 deletions pkg/dart2bytecode/lib/bytecode_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'package:kernel/external_name.dart' show getExternalName;
import 'package:kernel/library_index.dart' show LibraryIndex;
import 'package:kernel/target/targets.dart' show Target;
import 'package:kernel/type_algebra.dart'
show Substitution, containsTypeVariable;
show Substitution, containsTypeParameter;
import 'package:kernel/type_environment.dart'
show StatefulStaticTypeContext, SubtypeCheckMode, TypeEnvironment;

Expand Down Expand Up @@ -1299,15 +1299,15 @@ class BytecodeGenerator extends RecursiveVisitor {
void _genPushInstantiatorAndFunctionTypeArguments(List<DartType> types) {
final classTypeParameters = this.classTypeParameters;
if (classTypeParameters != null &&
types.any((t) => containsTypeVariable(t, classTypeParameters))) {
types.any((t) => containsTypeParameter(t, classTypeParameters))) {
assert(instantiatorTypeArguments != null);
_genPushInstantiatorTypeArguments();
} else {
asm.emitPushNull();
}
final functionTypeParametersSet = this.functionTypeParametersSet;
if (functionTypeParametersSet != null &&
types.any((t) => containsTypeVariable(t, functionTypeParametersSet))) {
types.any((t) => containsTypeParameter(t, functionTypeParametersSet))) {
_genPushFunctionTypeArguments();
} else {
asm.emitPushNull();
Expand Down Expand Up @@ -1998,7 +1998,7 @@ class BytecodeGenerator extends RecursiveVisitor {
// instantiate default types.
if (isClosure &&
defaultTypes
.any((t) => containsTypeVariable(t, functionTypeParametersSet!))) {
.any((t) => containsTypeParameter(t, functionTypeParametersSet!))) {
asm.emitPush(locals.closureVarIndexInFrame);
asm.emitLoadFieldTOS(cp.addInstanceField(closureFunctionTypeArguments));
asm.emitPopLocal(locals.functionTypeArgsVarIndexInFrame);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ abstract class IncrementalKernelGenerator {
/// expression is compiled.
///
/// [expression] may use the variables supplied in [definitions] as free
/// variables and [typeDefinitions] as free type variables. These will become
/// variables and [typeDefinitions] as free type parameters. These will become
/// required parameters to the compiled function. All elements of
/// [definitions] and [typeDefinitions] will become parameters/type
/// parameters, whether or not they appear free in [expression]. The type
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/lib/src/base/incremental_compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
.buildSyntheticLibrariesUntilBuildScopes([debugLibrary]);
lastGoodKernelTarget
.buildSyntheticLibrariesUntilComputeDefaultTypes([debugLibrary]);
lastGoodKernelTarget.loader.finishTypeVariables(
lastGoodKernelTarget.loader.finishTypeParameters(
[debugLibrary],
lastGoodKernelTarget.objectClassBuilder,
lastGoodKernelTarget.dynamicType);
Expand Down
10 changes: 5 additions & 5 deletions pkg/front_end/lib/src/base/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ class TypeParameterScope extends AbstractTypeParameterScope {
Builder? getTypeParameter(String name) => _typeParameters[name];

static LookupScope fromList(
LookupScope parent, List<TypeVariableBuilder>? typeVariableBuilders) {
if (typeVariableBuilders == null) return parent;
LookupScope parent, List<TypeParameterBuilder>? typeParameterBuilders) {
if (typeParameterBuilders == null) return parent;
Map<String, Builder> map = {};
for (TypeVariableBuilder typeVariableBuilder in typeVariableBuilders) {
if (typeVariableBuilder.isWildcard) continue;
map[typeVariableBuilder.name] = typeVariableBuilder;
for (TypeParameterBuilder typeParameterBuilder in typeParameterBuilders) {
if (typeParameterBuilder.isWildcard) continue;
map[typeParameterBuilder.name] = typeParameterBuilder;
}
return new TypeParameterScope(parent, map);
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/front_end/lib/src/builder/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ abstract class Builder {

bool get isTypeDeclaration;

bool get isTypeVariable;
bool get isTypeParameter;

/// Applies [augmentation] to this declaration.
void applyAugmentation(Builder augmentation);
Expand Down Expand Up @@ -362,7 +362,7 @@ abstract class BuilderImpl implements Builder {
bool get isTypeDeclaration => false;

@override
bool get isTypeVariable => false;
bool get isTypeParameter => false;

@override
// Coverage-ignore(suite): Not run.
Expand Down
20 changes: 10 additions & 10 deletions pkg/front_end/lib/src/builder/class_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ abstract class ClassMemberAccess {
}

abstract class ClassBuilder implements DeclarationBuilder, ClassMemberAccess {
/// The type variables declared on a class, extension or mixin declaration.
List<NominalVariableBuilder>? get typeVariables;
/// The type parameters declared on a class, extension or mixin declaration.
List<NominalParameterBuilder>? get typeParameters;

/// The type in the `extends` clause of a class declaration.
///
Expand Down Expand Up @@ -259,19 +259,19 @@ abstract class ClassBuilderImpl extends DeclarationBuilderImpl
// Coverage-ignore(suite): Not run.
InterfaceType get legacyRawType {
return _legacyRawType ??= new InterfaceType(cls, Nullability.legacy,
new List<DartType>.filled(typeVariablesCount, const DynamicType()));
new List<DartType>.filled(typeParametersCount, const DynamicType()));
}

InterfaceType get nullableRawType {
return _nullableRawType ??= new InterfaceType(cls, Nullability.nullable,
new List<DartType>.filled(typeVariablesCount, const DynamicType()));
new List<DartType>.filled(typeParametersCount, const DynamicType()));
}

InterfaceType get nonNullableRawType {
return _nonNullableRawType ??= new InterfaceType(
cls,
Nullability.nonNullable,
new List<DartType>.filled(typeVariablesCount, const DynamicType()));
new List<DartType>.filled(typeParametersCount, const DynamicType()));
}

InterfaceType rawType(Nullability nullability) {
Expand Down Expand Up @@ -343,15 +343,15 @@ abstract class ClassBuilderImpl extends DeclarationBuilderImpl
InterfaceType type = new InterfaceType(cls, nullability, arguments);
if (arguments.isEmpty) {
// Coverage-ignore-block(suite): Not run.
assert(typeVariablesCount == 0);
assert(typeParametersCount == 0);
if (nullability == Nullability.nonNullable) {
aliasedTypeWithBuiltArgumentsCacheNonNullable = type;
} else if (nullability == Nullability.nullable) {
aliasedTypeWithBuiltArgumentsCacheNullable = type;
}
}

if (typeVariablesCount != 0 && library is SourceLibraryBuilder) {
if (typeParametersCount != 0 && library is SourceLibraryBuilder) {
library.registerBoundsCheck(type, fileUri, charOffset, typeUse,
inferred: !hasExplicitTypeArguments);
}
Expand Down Expand Up @@ -462,14 +462,14 @@ abstract class ClassBuilderImpl extends DeclarationBuilderImpl

@override
Nullability computeNullabilityWithArguments(List<TypeBuilder>? typeArguments,
{required Map<TypeVariableBuilder, TraversalState>
typeVariablesTraversalState}) {
{required Map<TypeParameterBuilder, TraversalState>
typeParametersTraversalState}) {
if (isNullClass) {
return Nullability.nullable;
} else if (isFutureOr) {
if (typeArguments != null && typeArguments.length == 1) {
return typeArguments.single.computeNullability(
typeVariablesTraversalState: typeVariablesTraversalState);
typeParametersTraversalState: typeParametersTraversalState);
} else {
// This is `FutureOr<dynamic>`.
return Nullability.nullable;
Expand Down
2 changes: 1 addition & 1 deletion pkg/front_end/lib/src/builder/declaration_builders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ part 'invalid_type_declaration_builder.dart';
part 'omitted_type_declaration_builder.dart';
part 'type_alias_builder.dart';
part 'type_declaration_builder.dart';
part 'type_variable_builder.dart';
part 'type_parameter_builder.dart';

sealed class TypeDeclarationBuilder implements ITypeDeclarationBuilder {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class DynamicTypeDeclarationBuilder extends BuiltinTypeDeclarationBuilder {

@override
Nullability computeNullabilityWithArguments(List<TypeBuilder>? typeArguments,
{required Map<TypeVariableBuilder, TraversalState>
typeVariablesTraversalState}) {
{required Map<TypeParameterBuilder, TraversalState>
typeParametersTraversalState}) {
return Nullability.nullable;
}
}
6 changes: 3 additions & 3 deletions pkg/front_end/lib/src/builder/extension_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract class ExtensionBuilder implements DeclarationBuilder {
/// Type parameters declared on the extension.
///
/// This is `null` if the extension is not generic.
List<NominalVariableBuilder>? get typeParameters;
List<NominalParameterBuilder>? get typeParameters;

/// The type of the on-clause of the extension declaration.
TypeBuilder get onType;
Expand Down Expand Up @@ -55,7 +55,7 @@ abstract class ExtensionBuilderImpl extends DeclarationBuilderImpl
@override
// Coverage-ignore(suite): Not run.
Nullability computeNullabilityWithArguments(List<TypeBuilder>? typeArguments,
{required Map<TypeVariableBuilder, TraversalState>
typeVariablesTraversalState}) =>
{required Map<TypeParameterBuilder, TraversalState>
typeParametersTraversalState}) =>
Nullability.nonNullable;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ abstract class ExtensionTypeDeclarationBuilder
/// Type parameters declared on the extension type declaration.
///
/// This is `null` if the extension type declaration is not generic.
List<NominalVariableBuilder>? get typeParameters;
List<NominalParameterBuilder>? get typeParameters;

/// The type of the underlying representation.
DartType get declaredRepresentationType;
Expand Down Expand Up @@ -49,7 +49,7 @@ abstract class ExtensionTypeDeclarationBuilderImpl
{required bool hasExplicitTypeArguments}) {
ExtensionType type =
new ExtensionType(extensionTypeDeclaration, nullability, arguments);
if (typeVariablesCount != 0 && library is SourceLibraryBuilder) {
if (typeParametersCount != 0 && library is SourceLibraryBuilder) {
library.registerBoundsCheck(type, fileUri, charOffset, typeUse,
inferred: !hasExplicitTypeArguments);
}
Expand All @@ -58,8 +58,8 @@ abstract class ExtensionTypeDeclarationBuilderImpl

@override
Nullability computeNullabilityWithArguments(List<TypeBuilder>? typeArguments,
{required Map<TypeVariableBuilder, TraversalState>
typeVariablesTraversalState}) {
{required Map<TypeParameterBuilder, TraversalState>
typeParametersTraversalState}) {
return computeNullability();
}
}
18 changes: 9 additions & 9 deletions pkg/front_end/lib/src/builder/fixed_type_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ class FixedTypeBuilderImpl extends FixedTypeBuilder {
@override
// Coverage-ignore(suite): Not run.
Nullability computeNullability(
{required Map<TypeVariableBuilder, TraversalState>
typeVariablesTraversalState}) =>
{required Map<TypeParameterBuilder, TraversalState>
typeParametersTraversalState}) =>
type.nullability;

@override
// Coverage-ignore(suite): Not run.
VarianceCalculationValue computeTypeVariableBuilderVariance(
NominalVariableBuilder variable,
VarianceCalculationValue computeTypeParameterBuilderVariance(
NominalParameterBuilder nominalParameterBuilder,
{required SourceLoader sourceLoader}) {
return VarianceCalculationValue.calculatedUnrelated;
}
Expand All @@ -105,15 +105,15 @@ class FixedTypeBuilderImpl extends FixedTypeBuilder {

@override
// Coverage-ignore(suite): Not run.
void collectReferencesFrom(Map<TypeVariableBuilder, int> variableIndices,
void collectReferencesFrom(Map<TypeParameterBuilder, int> parameterIndices,
List<List<int>> edges, int index) {}

@override
// Coverage-ignore(suite): Not run.
TypeBuilder? substituteRange(
Map<TypeVariableBuilder, TypeBuilder> upperSubstitution,
Map<TypeVariableBuilder, TypeBuilder> lowerSubstitution,
List<StructuralVariableBuilder> unboundTypeVariables,
Map<TypeParameterBuilder, TypeBuilder> upperSubstitution,
Map<TypeParameterBuilder, TypeBuilder> lowerSubstitution,
List<StructuralParameterBuilder> unboundTypeParameters,
{Variance variance = Variance.covariant}) {
return null;
}
Expand All @@ -124,7 +124,7 @@ class FixedTypeBuilderImpl extends FixedTypeBuilder {

@override
// Coverage-ignore(suite): Not run.
bool usesTypeVariables(Set<String> typeVariableNames) => false;
bool usesTypeParameters(Set<String> typeParameterNames) => false;

@override
// Coverage-ignore(suite): Not run.
Expand Down
Loading

0 comments on commit 10387c3

Please sign in to comment.