[cfe][PrimaryConstructors] Use Object? as default for declaring parameter type inference
This adds a InferenceDefaultType enum to ensure that (declaring) parameter types are inferred as `Object?` instead of `dynamic`. Part of #61700 Change-Id: If64fef6b6621c7cd110f8ce418a952f8e05474af Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/478360 Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
committed by
Commit Queue
parent
ef8682a9f8
commit
1ff2dafd8d
@@ -35,6 +35,7 @@ import '../source/source_factory_builder.dart';
|
||||
import '../source/source_library_builder.dart';
|
||||
import '../source/source_member_builder.dart';
|
||||
import '../source/source_property_builder.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'builder.dart';
|
||||
import 'declaration_builders.dart';
|
||||
import 'omitted_type_builder.dart';
|
||||
@@ -278,7 +279,9 @@ class FormalParameterBuilder extends NamedBuilderImpl
|
||||
return new FormalParameterBuilder(
|
||||
kind: kind,
|
||||
modifiers: modifiers | Modifiers.InitializingFormal,
|
||||
type: builderFactory.addInferableType(),
|
||||
type: builderFactory.addInferableType(
|
||||
InferenceDefaultType.NullableObject,
|
||||
),
|
||||
name: name,
|
||||
fileOffset: fileOffset,
|
||||
nameOffset: nameOffset,
|
||||
|
||||
@@ -12,6 +12,7 @@ import '../kernel/type_algorithms.dart';
|
||||
import '../source/source_library_builder.dart';
|
||||
import '../source/source_loader.dart';
|
||||
import '../source/type_parameter_factory.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'declaration_builders.dart';
|
||||
import 'inferable_type_builder.dart';
|
||||
import 'library_builder.dart';
|
||||
@@ -161,6 +162,10 @@ class ImplicitTypeBuilder extends OmittedTypeBuilderImpl {
|
||||
class InferableTypeBuilder extends OmittedTypeBuilderImpl
|
||||
with InferableTypeBuilderMixin
|
||||
implements InferableType {
|
||||
final InferenceDefaultType inferenceDefaultType;
|
||||
|
||||
InferableTypeBuilder(this.inferenceDefaultType);
|
||||
|
||||
@override
|
||||
DartType build(
|
||||
LibraryBuilder library,
|
||||
@@ -229,7 +234,12 @@ class InferableTypeBuilder extends OmittedTypeBuilderImpl
|
||||
if (inferable != null) {
|
||||
inferable.inferTypes(hierarchy);
|
||||
} else {
|
||||
registerInferredType(const DynamicType());
|
||||
switch (inferenceDefaultType) {
|
||||
case InferenceDefaultType.NullableObject:
|
||||
registerInferredType(hierarchy.coreTypes.objectNullableRawType);
|
||||
case InferenceDefaultType.Dynamic:
|
||||
registerInferredType(const DynamicType());
|
||||
}
|
||||
}
|
||||
assert(hasType, "No type computed for $this");
|
||||
}
|
||||
@@ -273,8 +283,12 @@ abstract class Inferable {
|
||||
class InferableTypes {
|
||||
final List<InferableType> _inferableTypes = [];
|
||||
|
||||
InferableTypeBuilder addInferableType() {
|
||||
InferableTypeBuilder typeBuilder = new InferableTypeBuilder();
|
||||
InferableTypeBuilder addInferableType(
|
||||
InferenceDefaultType inferenceDefaultType,
|
||||
) {
|
||||
InferableTypeBuilder typeBuilder = new InferableTypeBuilder(
|
||||
inferenceDefaultType,
|
||||
);
|
||||
registerInferableType(typeBuilder);
|
||||
return typeBuilder;
|
||||
}
|
||||
|
||||
@@ -477,7 +477,9 @@ class EnumElementFragment implements Fragment {
|
||||
|
||||
EnumElementDeclaration? _declaration;
|
||||
|
||||
final TypeBuilder type = new InferableTypeBuilder();
|
||||
final TypeBuilder type = new InferableTypeBuilder(
|
||||
InferenceDefaultType.Dynamic,
|
||||
);
|
||||
|
||||
@override
|
||||
late final UriOffsetLength uriOffset = new UriOffsetLength(
|
||||
|
||||
@@ -37,6 +37,7 @@ import '../../source/type_parameter_factory.dart';
|
||||
import '../../type_inference/inference_results.dart';
|
||||
import '../../type_inference/type_inference_engine.dart';
|
||||
import '../../type_inference/type_inferrer.dart';
|
||||
import '../../util/helpers.dart';
|
||||
import '../fragment.dart';
|
||||
import '../getter/declaration.dart';
|
||||
import '../setter/declaration.dart';
|
||||
@@ -277,6 +278,9 @@ class RegularFieldDeclaration
|
||||
_encoding.type = value;
|
||||
}
|
||||
|
||||
@override
|
||||
InferenceDefaultType get inferenceDefaultType => InferenceDefaultType.Dynamic;
|
||||
|
||||
@override
|
||||
void buildBody(CoreTypes coreTypes, Expression? initializer) {
|
||||
assert(!hasBodyBeenBuilt, "Body has already been built for $this.");
|
||||
@@ -361,6 +365,7 @@ class RegularFieldDeclaration
|
||||
bodyBuilderContext: bodyBuilderContext,
|
||||
declaredFieldType: fieldType,
|
||||
token: token,
|
||||
inferenceDefaultType: inferenceDefaultType,
|
||||
);
|
||||
buildBody(classHierarchy.coreTypes, initializer);
|
||||
}
|
||||
@@ -374,6 +379,7 @@ class RegularFieldDeclaration
|
||||
required BodyBuilderContext bodyBuilderContext,
|
||||
DartType? declaredFieldType,
|
||||
required Token token,
|
||||
required InferenceDefaultType inferenceDefaultType,
|
||||
}) {
|
||||
LookupScope scope = _fragment.enclosingScope;
|
||||
ExpressionInferenceResult expressionInferenceResult = libraryBuilder.loader
|
||||
@@ -391,6 +397,7 @@ class RegularFieldDeclaration
|
||||
.dataForTesting
|
||||
// Coverage-ignore(suite): Not run.
|
||||
?.inferenceData,
|
||||
inferenceDefaultType: inferenceDefaultType,
|
||||
);
|
||||
if (computeSharedExpressionForTesting) {
|
||||
// Coverage-ignore-block(suite): Not run.
|
||||
@@ -646,6 +653,7 @@ class RegularFieldDeclaration
|
||||
libraryBuilder: libraryBuilder,
|
||||
bodyBuilderContext: createBodyBuilderContext(),
|
||||
token: token,
|
||||
inferenceDefaultType: InferenceDefaultType.Dynamic,
|
||||
);
|
||||
} else {
|
||||
return (const DynamicType(), null);
|
||||
@@ -948,6 +956,8 @@ mixin FieldFragmentDeclarationMixin implements FieldFragmentDeclaration {
|
||||
|
||||
Expression? get cachedFieldInitializer => _fieldInitializerCache;
|
||||
|
||||
InferenceDefaultType get inferenceDefaultType;
|
||||
|
||||
@override
|
||||
void buildFieldInitializer({
|
||||
required TypeInferrer typeInferrer,
|
||||
@@ -966,6 +976,7 @@ mixin FieldFragmentDeclarationMixin implements FieldFragmentDeclaration {
|
||||
fileUri: fileUri,
|
||||
declaredType: fieldType,
|
||||
initializer: initializer,
|
||||
inferenceDefaultType: inferenceDefaultType,
|
||||
)
|
||||
.expression;
|
||||
_hasInitializerBeenComputed = true;
|
||||
|
||||
@@ -63,6 +63,7 @@ import '../source/source_type_parameter_builder.dart';
|
||||
import '../source/type_parameter_factory.dart';
|
||||
import '../type_inference/inference_results.dart';
|
||||
import '../type_inference/type_inference_engine.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'constructor/declaration.dart';
|
||||
import 'factory/declaration.dart';
|
||||
import 'field/declaration.dart';
|
||||
|
||||
@@ -463,16 +463,22 @@ class PrimaryConstructorFieldDeclaration
|
||||
bodyBuilderContext: createBodyBuilderContext(),
|
||||
startToken: token,
|
||||
isLate: false,
|
||||
inferenceDefaultType: inferenceDefaultType,
|
||||
);
|
||||
return (
|
||||
expressionInferenceResult.inferredType,
|
||||
expressionInferenceResult.expression,
|
||||
);
|
||||
} else {
|
||||
return (const DynamicType(), null);
|
||||
assert(inferenceDefaultType == InferenceDefaultType.NullableObject);
|
||||
return (classHierarchy.coreTypes.objectNullableRawType, null);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
InferenceDefaultType get inferenceDefaultType =>
|
||||
InferenceDefaultType.NullableObject;
|
||||
|
||||
@override
|
||||
Initializer takePrimaryConstructorFieldInitializer() {
|
||||
throw new UnsupportedError(
|
||||
|
||||
@@ -47,6 +47,7 @@ import '../type_inference/type_inference_engine.dart';
|
||||
import '../type_inference/type_inferrer.dart'
|
||||
show TypeInferrer, InferredFunctionBody;
|
||||
import '../type_inference/type_schema.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'assigned_variables_impl.dart';
|
||||
import 'benchmarker.dart' show Benchmarker, BenchmarkSubdivides;
|
||||
import 'body_builder.dart';
|
||||
@@ -230,6 +231,7 @@ class Resolver {
|
||||
fileUri: fileUri,
|
||||
declaredType: const UnknownType(),
|
||||
initializer: initializer,
|
||||
inferenceDefaultType: InferenceDefaultType.Dynamic,
|
||||
);
|
||||
initializer = inferenceResult.expression;
|
||||
fieldType = inferenceResult.inferredType;
|
||||
@@ -249,6 +251,7 @@ class Resolver {
|
||||
DartType? declaredFieldType,
|
||||
required Token startToken,
|
||||
required InferenceDataForTesting? inferenceDataForTesting,
|
||||
required InferenceDefaultType inferenceDefaultType,
|
||||
}) {
|
||||
_ResolverContext context = new _ResolverContext(
|
||||
typeInferenceEngine: _typeInferenceEngine,
|
||||
@@ -276,6 +279,7 @@ class Resolver {
|
||||
fileUri: fileUri,
|
||||
declaredType: declaredFieldType,
|
||||
initializer: result.initializer,
|
||||
inferenceDefaultType: inferenceDefaultType,
|
||||
);
|
||||
context.performBacklog(result.annotations);
|
||||
return expressionInferenceResult;
|
||||
|
||||
@@ -21,6 +21,7 @@ import '../builder/nullability_builder.dart';
|
||||
import '../builder/omitted_type_builder.dart';
|
||||
import '../builder/type_builder.dart';
|
||||
import '../fragment/fragment.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'offset_map.dart';
|
||||
import 'source_type_parameter_builder.dart';
|
||||
import 'type_parameter_factory.dart';
|
||||
@@ -516,7 +517,9 @@ abstract class FragmentFactory {
|
||||
|
||||
TypeBuilder addVoidType(int charOffset);
|
||||
|
||||
InferableTypeBuilder addInferableType();
|
||||
InferableTypeBuilder addInferableType(
|
||||
InferenceDefaultType inferenceDefaultType,
|
||||
);
|
||||
|
||||
TypeParameterFragment addNominalParameter({
|
||||
required List<MetadataBuilder>? metadata,
|
||||
|
||||
@@ -42,6 +42,7 @@ import '../builder/omitted_type_builder.dart';
|
||||
import '../builder/type_builder.dart';
|
||||
import '../builder/void_type_builder.dart';
|
||||
import '../fragment/fragment.dart';
|
||||
import '../util/helpers.dart';
|
||||
import '../util/local_stack.dart';
|
||||
import 'fragment_factory.dart';
|
||||
import 'name_space_builder.dart';
|
||||
@@ -758,7 +759,7 @@ class FragmentFactoryImpl implements FragmentFactory {
|
||||
);
|
||||
}
|
||||
|
||||
Uri _resolve(Uri baseUri, String? uri, int uriOffset, {isPart = false}) {
|
||||
Uri _resolve(Uri baseUri, String? uri, int uriOffset, {bool isPart = false}) {
|
||||
if (uri == null) {
|
||||
// Coverage-ignore-block(suite): Not run.
|
||||
_problemReporting.addProblem(
|
||||
@@ -1459,7 +1460,7 @@ class FragmentFactoryImpl implements FragmentFactory {
|
||||
startOffset: startOffset,
|
||||
formalsOffset: formalsOffset,
|
||||
modifiers: isConst ? Modifiers.Const : Modifiers.empty,
|
||||
returnType: addInferableType(),
|
||||
returnType: addInferableType(InferenceDefaultType.Dynamic),
|
||||
typeParameterNameSpace: typeParameterNameSpace,
|
||||
typeParameterScope: typeParameterScope.lookupScope,
|
||||
formals: formals,
|
||||
@@ -1545,7 +1546,7 @@ class FragmentFactoryImpl implements FragmentFactory {
|
||||
endOffset: endOffset,
|
||||
modifiers: modifiers - Modifiers.Abstract,
|
||||
metadata: metadata,
|
||||
returnType: addInferableType(),
|
||||
returnType: addInferableType(InferenceDefaultType.Dynamic),
|
||||
typeParameters: typeParameters,
|
||||
typeParameterNameSpace: typeParameterNameSpace,
|
||||
enclosingScope: _declarationFragments.current.bodyScope,
|
||||
@@ -1925,7 +1926,7 @@ class FragmentFactoryImpl implements FragmentFactory {
|
||||
isTopLevel: enclosingDeclaration == null,
|
||||
metadata: metadata,
|
||||
modifiers: modifiers,
|
||||
returnType: returnType ?? addInferableType(),
|
||||
returnType: returnType ?? addInferableType(InferenceDefaultType.Dynamic),
|
||||
declaredTypeParameters: typeParameters,
|
||||
typeParameterNameSpace: typeParameterNameSpace,
|
||||
enclosingScope: enclosingDeclaration?.bodyScope ?? _compilationUnitScope,
|
||||
@@ -2086,7 +2087,7 @@ class FragmentFactoryImpl implements FragmentFactory {
|
||||
isTopLevel: enclosingDeclaration == null,
|
||||
metadata: metadata,
|
||||
modifiers: modifiers,
|
||||
returnType: returnType ?? addInferableType(),
|
||||
returnType: returnType ?? addInferableType(InferenceDefaultType.Dynamic),
|
||||
declaredTypeParameters: typeParameters,
|
||||
typeParameterNameSpace: typeParameterNameSpace,
|
||||
enclosingScope: enclosingDeclaration?.bodyScope ?? _compilationUnitScope,
|
||||
@@ -2136,7 +2137,7 @@ class FragmentFactoryImpl implements FragmentFactory {
|
||||
metadata: metadata,
|
||||
modifiers: modifiers,
|
||||
isTopLevel: isTopLevel,
|
||||
type: type ?? addInferableType(),
|
||||
type: type ?? addInferableType(InferenceDefaultType.Dynamic),
|
||||
name: info.identifier.name,
|
||||
nameOffset: info.identifier.nameOffset,
|
||||
endOffset: info.endOffset,
|
||||
@@ -2441,8 +2442,12 @@ class FragmentFactoryImpl implements FragmentFactory {
|
||||
}
|
||||
|
||||
@override
|
||||
InferableTypeBuilder addInferableType() {
|
||||
return _compilationUnit.loader.inferableTypes.addInferableType();
|
||||
InferableTypeBuilder addInferableType(
|
||||
InferenceDefaultType inferenceDefaultType,
|
||||
) {
|
||||
return _compilationUnit.loader.inferableTypes.addInferableType(
|
||||
inferenceDefaultType,
|
||||
);
|
||||
}
|
||||
|
||||
void _addFragment(Fragment fragment) {
|
||||
|
||||
@@ -54,6 +54,7 @@ import '../builder/record_type_builder.dart';
|
||||
import '../builder/type_builder.dart';
|
||||
import '../fragment/fragment.dart';
|
||||
import '../kernel/utils.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'check_helper.dart';
|
||||
import 'fragment_factory.dart';
|
||||
import 'offset_map.dart';
|
||||
@@ -3046,11 +3047,7 @@ class OutlineBuilder extends StackListenerImpl {
|
||||
metadata: metadata,
|
||||
kind: kind,
|
||||
modifiers: modifiers,
|
||||
type:
|
||||
type ??
|
||||
(memberKind.isParameterInferable(libraryFeatures)
|
||||
? _builderFactory.addInferableType()
|
||||
: const ImplicitTypeBuilder()),
|
||||
type: type ?? _createOmittedParameterTypeBuilder(memberKind),
|
||||
name: parameterName,
|
||||
publicName: publicName,
|
||||
hasThis: thisKeyword != null,
|
||||
@@ -3065,6 +3062,47 @@ class OutlineBuilder extends StackListenerImpl {
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates the [TypeBuilder] use for an omitted parameter type on the given
|
||||
/// member [kind].
|
||||
TypeBuilder _createOmittedParameterTypeBuilder(MemberKind kind) {
|
||||
switch (kind) {
|
||||
case MemberKind.Catch:
|
||||
case MemberKind.FunctionTypeAlias:
|
||||
case MemberKind.Factory:
|
||||
case MemberKind.FunctionTypedParameter:
|
||||
case MemberKind.GeneralizedFunctionType:
|
||||
case MemberKind.Local:
|
||||
case MemberKind.StaticMethod:
|
||||
case MemberKind.TopLevelMethod:
|
||||
case MemberKind.ExtensionNonStaticMethod:
|
||||
case MemberKind.ExtensionStaticMethod:
|
||||
case MemberKind.ExtensionTypeStaticMethod:
|
||||
// Parameter type is not inferred.
|
||||
return const ImplicitTypeBuilder();
|
||||
case MemberKind.NonStaticMethod:
|
||||
case MemberKind.ExtensionTypeNonStaticMethod:
|
||||
// TODO(eernst): Write a test such that this does run.
|
||||
case MemberKind.AnonymousMethod:
|
||||
// These can be inferred but cannot hold parameters so the cases are
|
||||
// dead code:
|
||||
case MemberKind.NonStaticField:
|
||||
case MemberKind.StaticField:
|
||||
case MemberKind.TopLevelField:
|
||||
// Parameter type is inferred with `dynamic` as default.
|
||||
return _builderFactory.addInferableType(InferenceDefaultType.Dynamic);
|
||||
case MemberKind.PrimaryConstructor:
|
||||
if (libraryFeatures.primaryConstructors.isEnabled) {
|
||||
// Parameter type is inferred with `Object?` as default.
|
||||
return _builderFactory.addInferableType(
|
||||
InferenceDefaultType.NullableObject,
|
||||
);
|
||||
} else {
|
||||
// Parameter type is not inferred.
|
||||
return const ImplicitTypeBuilder();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void beginFormalParameterDefaultValueExpression() {
|
||||
_insideOfFormalParameterType = false;
|
||||
@@ -4781,38 +4819,6 @@ class OutlineBuilder extends StackListenerImpl {
|
||||
}
|
||||
}
|
||||
|
||||
extension on MemberKind {
|
||||
/// Returns `true` if a parameter occurring in this context can be inferred.
|
||||
bool isParameterInferable(LibraryFeatures libraryFeatures) {
|
||||
switch (this) {
|
||||
case MemberKind.Catch:
|
||||
case MemberKind.FunctionTypeAlias:
|
||||
case MemberKind.Factory:
|
||||
case MemberKind.FunctionTypedParameter:
|
||||
case MemberKind.GeneralizedFunctionType:
|
||||
case MemberKind.Local:
|
||||
case MemberKind.StaticMethod:
|
||||
case MemberKind.TopLevelMethod:
|
||||
case MemberKind.ExtensionNonStaticMethod:
|
||||
case MemberKind.ExtensionStaticMethod:
|
||||
case MemberKind.ExtensionTypeStaticMethod:
|
||||
return false;
|
||||
case MemberKind.NonStaticMethod:
|
||||
case MemberKind.ExtensionTypeNonStaticMethod:
|
||||
// TODO(eernst): Write a test such that this does run.
|
||||
case MemberKind.AnonymousMethod:
|
||||
// These can be inferred but cannot hold parameters so the cases are
|
||||
// dead code:
|
||||
case MemberKind.NonStaticField:
|
||||
case MemberKind.StaticField:
|
||||
case MemberKind.TopLevelField:
|
||||
return true;
|
||||
case MemberKind.PrimaryConstructor:
|
||||
return libraryFeatures.primaryConstructors.isEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class EnumConstantInfo {
|
||||
final List<MetadataBuilder>? metadata;
|
||||
final String name;
|
||||
|
||||
@@ -45,6 +45,7 @@ import '../kernel/kernel_helper.dart';
|
||||
import '../kernel/member_covariance.dart';
|
||||
import '../kernel/type_algorithms.dart';
|
||||
import '../kernel/utils.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'builder_factory.dart';
|
||||
import 'name_scheme.dart';
|
||||
import 'name_space_builder.dart';
|
||||
@@ -311,7 +312,9 @@ class SourceEnumBuilder extends SourceClassBuilder {
|
||||
|
||||
ConstructorDeclaration constructorDeclaration =
|
||||
new DefaultEnumConstructorDeclaration(
|
||||
returnType: libraryBuilder.loader.inferableTypes.addInferableType(),
|
||||
returnType: libraryBuilder.loader.inferableTypes.addInferableType(
|
||||
InferenceDefaultType.Dynamic,
|
||||
),
|
||||
formals: [indexFormalParameterBuilder, nameFormalParameterBuilder],
|
||||
fileUri: fileUri,
|
||||
fileOffset: fileOffset,
|
||||
|
||||
@@ -60,6 +60,7 @@ import '../kernel/late_lowering.dart' as late_lowering;
|
||||
import '../source/check_helper.dart';
|
||||
import '../source/source_constructor_builder.dart';
|
||||
import '../source/source_library_builder.dart';
|
||||
import '../util/helpers.dart';
|
||||
import 'closure_context.dart';
|
||||
import 'context_allocation_strategy.dart';
|
||||
import 'external_ast_helper.dart';
|
||||
@@ -14866,7 +14867,12 @@ class InferenceVisitorImpl extends InferenceVisitorBase
|
||||
SharedTypeView variableTypeFromInitializerType(SharedTypeView type) {
|
||||
// TODO(paulberry): make a test verifying that we don't need to pass
|
||||
// `forSyntheticVariable: true` (and possibly a language issue)
|
||||
return new SharedTypeView(inferDeclarationType(type.unwrapTypeView()));
|
||||
return new SharedTypeView(
|
||||
inferDeclarationType(
|
||||
type.unwrapTypeView(),
|
||||
inferenceDefaultType: InferenceDefaultType.Dynamic,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -17104,6 +17110,7 @@ class InferenceVisitorImpl extends InferenceVisitorBase
|
||||
inferredType = inferDeclarationType(
|
||||
initializerResult.inferredType,
|
||||
forSyntheticVariable: node.name == null,
|
||||
inferenceDefaultType: InferenceDefaultType.Dynamic,
|
||||
);
|
||||
} else {
|
||||
inferredType = const DynamicType();
|
||||
|
||||
@@ -1654,15 +1654,22 @@ abstract class InferenceVisitorBase implements InferenceVisitor {
|
||||
DartType inferDeclarationType(
|
||||
DartType initializerType, {
|
||||
bool forSyntheticVariable = false,
|
||||
required InferenceDefaultType inferenceDefaultType,
|
||||
}) {
|
||||
if (forSyntheticVariable) {
|
||||
return initializerType;
|
||||
} else if (initializerType is NullType) {
|
||||
// If the initializer type is Null or bottom, the inferred type is
|
||||
// dynamic.
|
||||
// TODO(paulberry): this rule is inherited from analyzer behavior but is
|
||||
// not spec'ed anywhere.
|
||||
return const DynamicType();
|
||||
switch (inferenceDefaultType) {
|
||||
case InferenceDefaultType.NullableObject:
|
||||
// For primary constructors, `Object?` used in this case.
|
||||
return coreTypes.objectNullableRawType;
|
||||
case InferenceDefaultType.Dynamic:
|
||||
// If the initializer type is Null or bottom, the inferred type is
|
||||
// dynamic.
|
||||
// TODO(paulberry): this rule is inherited from analyzer behavior but
|
||||
// is not spec'ed anywhere.
|
||||
return const DynamicType();
|
||||
}
|
||||
} else {
|
||||
return demoteTypeInLibrary(initializerType);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import '../kernel/benchmarker.dart' show BenchmarkSubdivides, Benchmarker;
|
||||
import '../kernel/internal_ast.dart';
|
||||
import '../source/source_constructor_builder.dart';
|
||||
import '../source/source_library_builder.dart' show SourceLibraryBuilder;
|
||||
import '../util/helpers.dart';
|
||||
import 'closure_context.dart';
|
||||
import 'context_allocation_strategy.dart';
|
||||
import 'inference_results.dart';
|
||||
@@ -43,11 +44,16 @@ abstract class TypeInferrer {
|
||||
|
||||
AssignedVariablesImpl get assignedVariables;
|
||||
|
||||
/// Performs full type inference on the given field initializer.
|
||||
/// Performs type inference on the given field [initializer] with the given
|
||||
/// [declaredType], if any.
|
||||
///
|
||||
/// When [declaredType] is `null` and the [initializer] has type `Null`, the
|
||||
/// inferred field type is determined by [inferenceDefaultType].
|
||||
ExpressionInferenceResult inferFieldInitializer({
|
||||
required Uri fileUri,
|
||||
DartType? declaredType,
|
||||
required Expression initializer,
|
||||
required InferenceDefaultType inferenceDefaultType,
|
||||
});
|
||||
|
||||
/// Performs type inference on the given function body.
|
||||
@@ -196,6 +202,7 @@ class TypeInferrerImpl implements TypeInferrer {
|
||||
required Uri fileUri,
|
||||
DartType? declaredType,
|
||||
required Expression initializer,
|
||||
required InferenceDefaultType inferenceDefaultType,
|
||||
}) {
|
||||
InferenceVisitorBase visitor = _createInferenceVisitor(fileUri: fileUri);
|
||||
ExpressionInferenceResult initializerResult = visitor.inferExpression(
|
||||
@@ -214,7 +221,10 @@ class TypeInferrerImpl implements TypeInferrer {
|
||||
// If the field has no declared type, compute the field type from the
|
||||
// inferred type.
|
||||
initializerResult = new ExpressionInferenceResult(
|
||||
visitor.inferDeclarationType(initializerResult.inferredType),
|
||||
visitor.inferDeclarationType(
|
||||
initializerResult.inferredType,
|
||||
inferenceDefaultType: inferenceDefaultType,
|
||||
),
|
||||
initializerResult.expression,
|
||||
);
|
||||
}
|
||||
@@ -437,12 +447,14 @@ class TypeInferrerImplBenchmarked implements TypeInferrer {
|
||||
required Uri fileUri,
|
||||
DartType? declaredType,
|
||||
required Expression initializer,
|
||||
required InferenceDefaultType inferenceDefaultType,
|
||||
}) {
|
||||
benchmarker.beginSubdivide(BenchmarkSubdivides.inferFieldInitializer);
|
||||
ExpressionInferenceResult result = impl.inferFieldInitializer(
|
||||
fileUri: fileUri,
|
||||
declaredType: declaredType,
|
||||
initializer: initializer,
|
||||
inferenceDefaultType: inferenceDefaultType,
|
||||
);
|
||||
benchmarker.endSubdivide();
|
||||
return result;
|
||||
|
||||
@@ -62,3 +62,17 @@ int? tryParseRecordPositionalGetterName(String name, int positionalFieldCount) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Enum used to determine which type to use as the default type for inference
|
||||
/// of an omitted type declaration.
|
||||
///
|
||||
/// This is use for instance when a field or parameter has no type annotation
|
||||
/// and no initializer/default value, or when the initializer/default has type
|
||||
/// `Null`.
|
||||
enum InferenceDefaultType {
|
||||
/// Use `Object?` as the inferred type.
|
||||
NullableObject,
|
||||
|
||||
/// Use `dynamic` as the inferred type.
|
||||
Dynamic,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
typedef void Typedef1(a,{b});
|
||||
|
||||
method0(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
|
||||
class SuperClass {
|
||||
void method(void f(a,{b})) {
|
||||
|
||||
local(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
|
||||
try {} catch (e, s) {}
|
||||
}
|
||||
|
||||
void method1(int a, {int? b}) {}
|
||||
}
|
||||
|
||||
class SubClass extends SuperClass {
|
||||
SubClass();
|
||||
|
||||
SubClass.constructor1(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
|
||||
SubClass.constructor2(int x, String y, int z, String w);
|
||||
|
||||
SubClass.constructor3(a, {b = 0}) : this.constructor2(a, a, b, b); // Ok
|
||||
|
||||
factory SubClass.constructor4(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
|
||||
return SubClass();
|
||||
}
|
||||
|
||||
method1(a, {b}) {
|
||||
int x = a;
|
||||
String y = a; // Error
|
||||
int? z = b;
|
||||
String? w = b; // Error
|
||||
}
|
||||
|
||||
method2(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
|
||||
static method3(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
}
|
||||
|
||||
extension on int {
|
||||
method1(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
|
||||
static method2(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
}
|
||||
|
||||
extension type SuperExtensionType(int i) {
|
||||
void method3(int a, {int? b}) {}
|
||||
}
|
||||
|
||||
extension type SubExtensionType(int i) implements SuperExtensionType {
|
||||
method3(a, {b}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int? z = b;
|
||||
String? w = b; // Ok
|
||||
}
|
||||
|
||||
method4(a, {b = 0}) {
|
||||
int x = a;
|
||||
String y = a; // Ok
|
||||
int z = b;
|
||||
String w = b; // Ok
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/omitted_parameter_type.dart:55:16: Error: A value of type 'int' can't be assigned to a variable of type 'String'.
|
||||
// String y = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/omitted_parameter_type.dart:57:17: Error: A value of type 'int?' can't be assigned to a variable of type 'String?'.
|
||||
// String? w = b; // Error
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef Typedef1 = (dynamic, {b: dynamic}) → void;
|
||||
class SuperClass extends core::Object {
|
||||
synthetic constructor •() → self::SuperClass
|
||||
: super core::Object::•()
|
||||
;
|
||||
method method((dynamic, {b: dynamic}) → void f) → void {
|
||||
function local(dynamic a, {dynamic b = #C1}) → Null {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
try {
|
||||
}
|
||||
on core::Object catch(final core::Object e, final core::StackTrace s) {
|
||||
}
|
||||
}
|
||||
method method1(core::int a, {core::int? b = #C2}) → void {}
|
||||
}
|
||||
class SubClass extends self::SuperClass {
|
||||
constructor •() → self::SubClass
|
||||
: super self::SuperClass::•()
|
||||
;
|
||||
constructor constructor1(dynamic a, {dynamic b = #C1}) → self::SubClass
|
||||
: super self::SuperClass::•() {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
constructor constructor2(core::int x, core::String y, core::int z, core::String w) → self::SubClass
|
||||
: super self::SuperClass::•()
|
||||
;
|
||||
constructor constructor3(dynamic a, {dynamic b = #C1}) → self::SubClass
|
||||
: this self::SubClass::constructor2(a as{TypeError,ForDynamic} core::int, a as{TypeError,ForDynamic} core::String, b as{TypeError,ForDynamic} core::int, b as{TypeError,ForDynamic} core::String)
|
||||
;
|
||||
static factory constructor4(dynamic a, {dynamic b = #C1}) → self::SubClass {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
return new self::SubClass::•();
|
||||
}
|
||||
method method1(core::int a, {core::int? b = #C2}) → void {
|
||||
core::int x = a;
|
||||
core::String y = invalid-expression "pkg/front_end/testcases/general/omitted_parameter_type.dart:55:16: Error: A value of type 'int' can't be assigned to a variable of type 'String'.
|
||||
String y = a; // Error
|
||||
^" in a as{TypeError} core::String;
|
||||
core::int? z = b;
|
||||
core::String? w = invalid-expression "pkg/front_end/testcases/general/omitted_parameter_type.dart:57:17: Error: A value of type 'int?' can't be assigned to a variable of type 'String?'.
|
||||
String? w = b; // Error
|
||||
^" in b as{TypeError} core::String?;
|
||||
}
|
||||
method method2(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static method method3(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
}
|
||||
extension /* unnamed */ _extension#0 on core::int {
|
||||
method method1 = self::_extension#0|method1;
|
||||
method tearoff method1 = self::_extension#0|get#method1;
|
||||
static method method2 = self::_extension#0|method2;
|
||||
}
|
||||
extension type SuperExtensionType(core::int i) {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SuperExtensionType|method3;
|
||||
method tearoff method3 = self::SuperExtensionType|get#method3;
|
||||
constructor • = self::SuperExtensionType|constructor#;
|
||||
constructor tearoff • = self::SuperExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type SubExtensionType(core::int i) implements self::SuperExtensionType% /* erasure=core::int, declared=! */ {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SubExtensionType|method3;
|
||||
method tearoff method3 = self::SubExtensionType|get#method3;
|
||||
method method4 = self::SubExtensionType|method4;
|
||||
method tearoff method4 = self::SubExtensionType|get#method4;
|
||||
constructor • = self::SubExtensionType|constructor#;
|
||||
constructor tearoff • = self::SubExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
static method method0(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-member method _extension#0|method1(lowered final core::int #this, dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-member method _extension#0|get#method1(lowered final core::int #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C1}) → dynamic => self::_extension#0|method1(#this, a, b: b);
|
||||
static extension-member method _extension#0|method2(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-type-member method SuperExtensionType|constructor#(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method SuperExtensionType|constructor#_#new#tearOff(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SuperExtensionType|constructor#(i);
|
||||
static extension-type-member method SuperExtensionType|method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this, core::int a, {core::int? b = #C2}) → void {}
|
||||
static extension-type-member method SuperExtensionType|get#method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this) → (core::int, {b: core::int?}) → void
|
||||
return (core::int a, {core::int? b = #C2}) → void => self::SuperExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|constructor#(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method SubExtensionType|constructor#_#new#tearOff(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SubExtensionType|constructor#(i);
|
||||
static extension-type-member method SubExtensionType|method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {dynamic b = #C2}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int? z = b as{TypeError,ForDynamic} core::int?;
|
||||
core::String? w = b as{TypeError,ForDynamic} core::String?;
|
||||
}
|
||||
static extension-type-member method SubExtensionType|get#method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C2}) → dynamic => self::SubExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-type-member method SubExtensionType|get#method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C1}) → dynamic => self::SubExtensionType|method4(#this, a, b: b);
|
||||
|
||||
constants {
|
||||
#C1 = 0
|
||||
#C2 = null
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/omitted_parameter_type.dart:55:16: Error: A value of type 'int' can't be assigned to a variable of type 'String'.
|
||||
// String y = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/omitted_parameter_type.dart:57:17: Error: A value of type 'int?' can't be assigned to a variable of type 'String?'.
|
||||
// String? w = b; // Error
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef Typedef1 = (dynamic, {b: dynamic}) → void;
|
||||
class SuperClass extends core::Object {
|
||||
synthetic constructor •() → self::SuperClass
|
||||
: super core::Object::•()
|
||||
;
|
||||
method method((dynamic, {b: dynamic}) → void f) → void {
|
||||
function local(dynamic a, {dynamic b = #C1}) → Null {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
try {
|
||||
}
|
||||
on core::Object catch(final core::Object e, final core::StackTrace s) {
|
||||
}
|
||||
}
|
||||
method method1(core::int a, {core::int? b = #C2}) → void {}
|
||||
}
|
||||
class SubClass extends self::SuperClass {
|
||||
constructor •() → self::SubClass
|
||||
: super self::SuperClass::•()
|
||||
;
|
||||
constructor constructor1(dynamic a, {dynamic b = #C1}) → self::SubClass
|
||||
: super self::SuperClass::•() {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
constructor constructor2(core::int x, core::String y, core::int z, core::String w) → self::SubClass
|
||||
: super self::SuperClass::•()
|
||||
;
|
||||
constructor constructor3(dynamic a, {dynamic b = #C1}) → self::SubClass
|
||||
: this self::SubClass::constructor2(a as{TypeError,ForDynamic} core::int, a as{TypeError,ForDynamic} core::String, b as{TypeError,ForDynamic} core::int, b as{TypeError,ForDynamic} core::String)
|
||||
;
|
||||
static factory constructor4(dynamic a, {dynamic b = #C1}) → self::SubClass {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
return new self::SubClass::•();
|
||||
}
|
||||
method method1(core::int a, {core::int? b = #C2}) → void {
|
||||
core::int x = a;
|
||||
core::String y = invalid-expression "pkg/front_end/testcases/general/omitted_parameter_type.dart:55:16: Error: A value of type 'int' can't be assigned to a variable of type 'String'.
|
||||
String y = a; // Error
|
||||
^" in a as{TypeError} core::String;
|
||||
core::int? z = b;
|
||||
core::String? w = invalid-expression "pkg/front_end/testcases/general/omitted_parameter_type.dart:57:17: Error: A value of type 'int?' can't be assigned to a variable of type 'String?'.
|
||||
String? w = b; // Error
|
||||
^" in b as{TypeError} core::String?;
|
||||
}
|
||||
method method2(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static method method3(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
}
|
||||
extension /* unnamed */ _extension#0 on core::int {
|
||||
method method1 = self::_extension#0|method1;
|
||||
method tearoff method1 = self::_extension#0|get#method1;
|
||||
static method method2 = self::_extension#0|method2;
|
||||
}
|
||||
extension type SuperExtensionType(core::int i) {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SuperExtensionType|method3;
|
||||
method tearoff method3 = self::SuperExtensionType|get#method3;
|
||||
constructor • = self::SuperExtensionType|constructor#;
|
||||
constructor tearoff • = self::SuperExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type SubExtensionType(core::int i) implements self::SuperExtensionType% /* erasure=core::int, declared=! */ {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SubExtensionType|method3;
|
||||
method tearoff method3 = self::SubExtensionType|get#method3;
|
||||
method method4 = self::SubExtensionType|method4;
|
||||
method tearoff method4 = self::SubExtensionType|get#method4;
|
||||
constructor • = self::SubExtensionType|constructor#;
|
||||
constructor tearoff • = self::SubExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
static method method0(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-member method _extension#0|method1(lowered final core::int #this, dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-member method _extension#0|get#method1(lowered final core::int #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C1}) → dynamic => self::_extension#0|method1(#this, a, b: b);
|
||||
static extension-member method _extension#0|method2(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-type-member method SuperExtensionType|constructor#(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method SuperExtensionType|constructor#_#new#tearOff(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SuperExtensionType|constructor#(i);
|
||||
static extension-type-member method SuperExtensionType|method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this, core::int a, {core::int? b = #C2}) → void {}
|
||||
static extension-type-member method SuperExtensionType|get#method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this) → (core::int, {b: core::int?}) → void
|
||||
return (core::int a, {core::int? b = #C2}) → void => self::SuperExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|constructor#(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method SubExtensionType|constructor#_#new#tearOff(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SubExtensionType|constructor#(i);
|
||||
static extension-type-member method SubExtensionType|method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {dynamic b = #C2}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int? z = b as{TypeError,ForDynamic} core::int?;
|
||||
core::String? w = b as{TypeError,ForDynamic} core::String?;
|
||||
}
|
||||
static extension-type-member method SubExtensionType|get#method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C2}) → dynamic => self::SubExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-type-member method SubExtensionType|get#method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C1}) → dynamic => self::SubExtensionType|method4(#this, a, b: b);
|
||||
|
||||
constants {
|
||||
#C1 = 0
|
||||
#C2 = null
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef Typedef1 = (dynamic, {b: dynamic}) → void;
|
||||
class SuperClass extends core::Object {
|
||||
synthetic constructor •() → self::SuperClass
|
||||
;
|
||||
method method((dynamic, {b: dynamic}) → void f) → void
|
||||
;
|
||||
method method1(core::int a, {core::int? b = null}) → void
|
||||
;
|
||||
}
|
||||
class SubClass extends self::SuperClass {
|
||||
constructor •() → self::SubClass
|
||||
;
|
||||
constructor constructor1(dynamic a, {dynamic b = 0}) → self::SubClass
|
||||
;
|
||||
constructor constructor2(core::int x, core::String y, core::int z, core::String w) → self::SubClass
|
||||
;
|
||||
constructor constructor3(dynamic a, {dynamic b = 0}) → self::SubClass
|
||||
;
|
||||
static factory constructor4(dynamic a, {dynamic b = 0}) → self::SubClass
|
||||
;
|
||||
method method1(core::int a, {core::int? b = null}) → void
|
||||
;
|
||||
method method2(dynamic a, {dynamic b = 0}) → dynamic
|
||||
;
|
||||
static method method3(dynamic a, {has-declared-initializer dynamic b}) → dynamic
|
||||
;
|
||||
}
|
||||
extension /* unnamed */ _extension#0 on core::int {
|
||||
method method1 = self::_extension#0|method1;
|
||||
method tearoff method1 = self::_extension#0|get#method1;
|
||||
static method method2 = self::_extension#0|method2;
|
||||
}
|
||||
extension type SuperExtensionType(core::int i) {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SuperExtensionType|method3;
|
||||
method tearoff method3 = self::SuperExtensionType|get#method3;
|
||||
constructor • = self::SuperExtensionType|constructor#;
|
||||
constructor tearoff • = self::SuperExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type SubExtensionType(core::int i) implements self::SuperExtensionType% /* erasure=core::int, declared=! */ {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SubExtensionType|method3;
|
||||
method tearoff method3 = self::SubExtensionType|get#method3;
|
||||
method method4 = self::SubExtensionType|method4;
|
||||
method tearoff method4 = self::SubExtensionType|get#method4;
|
||||
constructor • = self::SubExtensionType|constructor#;
|
||||
constructor tearoff • = self::SubExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
static method method0(dynamic a, {has-declared-initializer dynamic b}) → dynamic
|
||||
;
|
||||
static extension-member method _extension#0|method1(lowered final core::int #this, dynamic a, {has-declared-initializer dynamic b}) → dynamic
|
||||
;
|
||||
static extension-member method _extension#0|get#method1(lowered final core::int #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b}) → dynamic => self::_extension#0|method1(#this, a, b: b);
|
||||
static extension-member method _extension#0|method2(dynamic a, {has-declared-initializer dynamic b}) → dynamic
|
||||
;
|
||||
static extension-type-member method SuperExtensionType|constructor#(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method SuperExtensionType|constructor#_#new#tearOff(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SuperExtensionType|constructor#(i);
|
||||
static extension-type-member method SuperExtensionType|method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this, core::int a, {core::int? b}) → void
|
||||
;
|
||||
static extension-type-member method SuperExtensionType|get#method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this) → (core::int, {b: core::int?}) → void
|
||||
return (core::int a, {core::int? b}) → void => self::SuperExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|constructor#(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method SubExtensionType|constructor#_#new#tearOff(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SubExtensionType|constructor#(i);
|
||||
static extension-type-member method SubExtensionType|method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {dynamic b}) → dynamic
|
||||
;
|
||||
static extension-type-member method SubExtensionType|get#method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b}) → dynamic => self::SubExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {has-declared-initializer dynamic b}) → dynamic
|
||||
;
|
||||
static extension-type-member method SubExtensionType|get#method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b}) → dynamic => self::SubExtensionType|method4(#this, a, b: b);
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/omitted_parameter_type.dart:55:16: Error: A value of type 'int' can't be assigned to a variable of type 'String'.
|
||||
// String y = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/omitted_parameter_type.dart:57:17: Error: A value of type 'int?' can't be assigned to a variable of type 'String?'.
|
||||
// String? w = b; // Error
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef Typedef1 = (dynamic, {b: dynamic}) → void;
|
||||
class SuperClass extends core::Object {
|
||||
synthetic constructor •() → self::SuperClass
|
||||
: super core::Object::•()
|
||||
;
|
||||
method method((dynamic, {b: dynamic}) → void f) → void {
|
||||
function local(dynamic a, {dynamic b = #C1}) → Null {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
try {
|
||||
}
|
||||
on core::Object catch(final core::Object e, final core::StackTrace s) {
|
||||
}
|
||||
}
|
||||
method method1(core::int a, {core::int? b = #C2}) → void {}
|
||||
}
|
||||
class SubClass extends self::SuperClass {
|
||||
constructor •() → self::SubClass
|
||||
: super self::SuperClass::•()
|
||||
;
|
||||
constructor constructor1(dynamic a, {dynamic b = #C1}) → self::SubClass
|
||||
: super self::SuperClass::•() {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
constructor constructor2(core::int x, core::String y, core::int z, core::String w) → self::SubClass
|
||||
: super self::SuperClass::•()
|
||||
;
|
||||
constructor constructor3(dynamic a, {dynamic b = #C1}) → self::SubClass
|
||||
: this self::SubClass::constructor2(a as{TypeError,ForDynamic} core::int, a as{TypeError,ForDynamic} core::String, b as{TypeError,ForDynamic} core::int, b as{TypeError,ForDynamic} core::String)
|
||||
;
|
||||
static factory constructor4(dynamic a, {dynamic b = #C1}) → self::SubClass {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
return new self::SubClass::•();
|
||||
}
|
||||
method method1(core::int a, {core::int? b = #C2}) → void {
|
||||
core::int x = a;
|
||||
core::String y = invalid-expression "pkg/front_end/testcases/general/omitted_parameter_type.dart:55:16: Error: A value of type 'int' can't be assigned to a variable of type 'String'.
|
||||
String y = a; // Error
|
||||
^" in a as{TypeError} core::String;
|
||||
core::int? z = b;
|
||||
core::String? w = invalid-expression "pkg/front_end/testcases/general/omitted_parameter_type.dart:57:17: Error: A value of type 'int?' can't be assigned to a variable of type 'String?'.
|
||||
String? w = b; // Error
|
||||
^" in b as{TypeError} core::String?;
|
||||
}
|
||||
method method2(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static method method3(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
}
|
||||
extension /* unnamed */ _extension#0 on core::int {
|
||||
method method1 = self::_extension#0|method1;
|
||||
method tearoff method1 = self::_extension#0|get#method1;
|
||||
static method method2 = self::_extension#0|method2;
|
||||
}
|
||||
extension type SuperExtensionType(core::int i) {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SuperExtensionType|method3;
|
||||
method tearoff method3 = self::SuperExtensionType|get#method3;
|
||||
constructor • = self::SuperExtensionType|constructor#;
|
||||
constructor tearoff • = self::SuperExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type SubExtensionType(core::int i) implements self::SuperExtensionType% /* erasure=core::int, declared=! */ {
|
||||
abstract extension-type-member representation-field get i() → core::int;
|
||||
method method3 = self::SubExtensionType|method3;
|
||||
method tearoff method3 = self::SubExtensionType|get#method3;
|
||||
method method4 = self::SubExtensionType|method4;
|
||||
method tearoff method4 = self::SubExtensionType|get#method4;
|
||||
constructor • = self::SubExtensionType|constructor#;
|
||||
constructor tearoff • = self::SubExtensionType|constructor#_#new#tearOff;
|
||||
}
|
||||
static method method0(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-member method _extension#0|method1(lowered final core::int #this, dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-member method _extension#0|get#method1(lowered final core::int #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C1}) → dynamic => self::_extension#0|method1(#this, a, b: b);
|
||||
static extension-member method _extension#0|method2(dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-type-member method SuperExtensionType|constructor#(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method SuperExtensionType|constructor#_#new#tearOff(core::int i) → self::SuperExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SuperExtensionType|constructor#(i);
|
||||
static extension-type-member method SuperExtensionType|method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this, core::int a, {core::int? b = #C2}) → void {}
|
||||
static extension-type-member method SuperExtensionType|get#method3(lowered final self::SuperExtensionType% /* erasure=core::int, declared=! */ #this) → (core::int, {b: core::int?}) → void
|
||||
return (core::int a, {core::int? b = #C2}) → void => self::SuperExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|constructor#(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */ {
|
||||
lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method SubExtensionType|constructor#_#new#tearOff(core::int i) → self::SubExtensionType% /* erasure=core::int, declared=! */
|
||||
return self::SubExtensionType|constructor#(i);
|
||||
static extension-type-member method SubExtensionType|method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {dynamic b = #C2}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int? z = b as{TypeError,ForDynamic} core::int?;
|
||||
core::String? w = b as{TypeError,ForDynamic} core::String?;
|
||||
}
|
||||
static extension-type-member method SubExtensionType|get#method3(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C2}) → dynamic => self::SubExtensionType|method3(#this, a, b: b);
|
||||
static extension-type-member method SubExtensionType|method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this, dynamic a, {dynamic b = #C1}) → dynamic {
|
||||
core::int x = a as{TypeError,ForDynamic} core::int;
|
||||
core::String y = a as{TypeError,ForDynamic} core::String;
|
||||
core::int z = b as{TypeError,ForDynamic} core::int;
|
||||
core::String w = b as{TypeError,ForDynamic} core::String;
|
||||
}
|
||||
static extension-type-member method SubExtensionType|get#method4(lowered final self::SubExtensionType% /* erasure=core::int, declared=! */ #this) → (dynamic, {b: dynamic}) → dynamic
|
||||
return (dynamic a, {dynamic b = #C1}) → dynamic => self::SubExtensionType|method4(#this, a, b: b);
|
||||
|
||||
constants {
|
||||
#C1 = 0
|
||||
#C2 = null
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
typedef void Typedef1(a, {b});
|
||||
|
||||
method0(a, {b = 0}) {}
|
||||
|
||||
class SuperClass {
|
||||
void method(void f(a, {b})) {}
|
||||
void method1(int a, {int? b}) {}
|
||||
}
|
||||
|
||||
class SubClass extends SuperClass {
|
||||
SubClass();
|
||||
SubClass.constructor1(a, {b = 0}) {}
|
||||
SubClass.constructor2(int x, String y, int z, String w);
|
||||
SubClass.constructor3(a, {b = 0}) : this.constructor2(a, a, b, b);
|
||||
factory SubClass.constructor4(a, {b = 0}) {}
|
||||
method1(a, {b}) {}
|
||||
method2(a, {b = 0}) {}
|
||||
static method3(a, {b = 0}) {}
|
||||
}
|
||||
|
||||
extension on int {
|
||||
method1(a, {b = 0}) {}
|
||||
static method2(a, {b = 0}) {}
|
||||
}
|
||||
|
||||
extension type SuperExtensionType(int i) {
|
||||
void method3(int a, {int? b}) {}
|
||||
}
|
||||
|
||||
extension type SubExtensionType(int i) implements SuperExtensionType {
|
||||
method3(a, {b}) {}
|
||||
method4(a, {b = 0}) {}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
class SubClass extends SuperClass {
|
||||
SubClass();
|
||||
SubClass.constructor1(a, {b = 0}) {}
|
||||
SubClass.constructor2(int x, String y, int z, String w);
|
||||
SubClass.constructor3(a, {b = 0}) : this.constructor2(a, a, b, b);
|
||||
factory SubClass.constructor4(a, {b = 0}) {}
|
||||
method1(a, {b}) {}
|
||||
method2(a, {b = 0}) {}
|
||||
static method3(a, {b = 0}) {}
|
||||
}
|
||||
|
||||
class SuperClass {
|
||||
void method(void f(a, {b})) {}
|
||||
void method1(int a, {int? b}) {}
|
||||
}
|
||||
|
||||
extension on int {
|
||||
method1(a, {b = 0}) {}
|
||||
static method2(a, {b = 0}) {}
|
||||
}
|
||||
|
||||
extension type SubExtensionType(int i) implements SuperExtensionType {
|
||||
method3(a, {b}) {}
|
||||
method4(a, {b = 0}) {}
|
||||
}
|
||||
|
||||
extension type SuperExtensionType(int i) {
|
||||
void method3(int a, {int? b}) {}
|
||||
}
|
||||
|
||||
method0(a, {b = 0}) {}
|
||||
|
||||
typedef void Typedef1(a, {b});
|
||||
+3
-3
@@ -71,7 +71,7 @@ import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
extension type ET0(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → dynamic;
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET0|constructor#;
|
||||
constructor tearoff • = self::ET0|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -151,11 +151,11 @@ extension type ET14(invalid-type #) {
|
||||
constructor • = self::ET14|constructor#;
|
||||
constructor tearoff • = self::ET14|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET0|constructor#(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET0|constructor#(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET0% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
return self::ET0|constructor#(a);
|
||||
static extension-type-member method ET1|constructor#(core::bool a) → self::ET1% /* erasure=core::bool, declared=! */ {
|
||||
lowered final self::ET1% /* erasure=core::bool, declared=! */ #this = a;
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
extension type ET0(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → dynamic;
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET0|constructor#;
|
||||
constructor tearoff • = self::ET0|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -151,11 +151,11 @@ extension type ET14(invalid-type #) {
|
||||
constructor • = self::ET14|constructor#;
|
||||
constructor tearoff • = self::ET14|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET0|constructor#(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET0|constructor#(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET0% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
return self::ET0|constructor#(a);
|
||||
static extension-type-member method ET1|constructor#(core::bool a) → self::ET1% /* erasure=core::bool, declared=! */ {
|
||||
lowered final self::ET1% /* erasure=core::bool, declared=! */ #this = a;
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
extension type ET0(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → dynamic;
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET0|constructor#;
|
||||
constructor tearoff • = self::ET0|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -151,9 +151,9 @@ extension type ET14(invalid-type #) {
|
||||
constructor • = self::ET14|constructor#;
|
||||
constructor tearoff • = self::ET14|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET0|constructor#(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member method ET0|constructor#(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
return self::ET0|constructor#(a);
|
||||
static extension-type-member method ET1|constructor#(core::bool a) → self::ET1% /* erasure=core::bool, declared=! */
|
||||
;
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
extension type ET0(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → dynamic;
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET0|constructor#;
|
||||
constructor tearoff • = self::ET0|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -151,11 +151,11 @@ extension type ET14(invalid-type #) {
|
||||
constructor • = self::ET14|constructor#;
|
||||
constructor tearoff • = self::ET14|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET0|constructor#(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET0|constructor#(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET0% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(dynamic a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET0|constructor#_#new#tearOff(core::Object? a) → self::ET0% /* erasure=dynamic, declared=! */
|
||||
return self::ET0|constructor#(a);
|
||||
static extension-type-member method ET1|constructor#(core::bool a) → self::ET1% /* erasure=core::bool, declared=! */ {
|
||||
lowered final self::ET1% /* erasure=core::bool, declared=! */ #this = a;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
class C1(a, var b, final c) {
|
||||
int d = a; // Error
|
||||
int e = b; // Error
|
||||
int f = c; // Error
|
||||
}
|
||||
|
||||
class C2([a = null, var b = null, final c = null]) {
|
||||
int d = a; // Error
|
||||
int e = b; // Error
|
||||
int f = c; // Error
|
||||
}
|
||||
|
||||
class C3({a = null, var b = null, final c = null}) {
|
||||
int d = a; // Error
|
||||
int e = b; // Error
|
||||
int f = c; // Error
|
||||
}
|
||||
|
||||
extension type ET1(a);
|
||||
|
||||
extension type ET2([a = null]);
|
||||
|
||||
extension type ET3({a = null});
|
||||
|
||||
test(C1 c1, C2 c2, C3 c3, ET1 e1, ET2 e2, ET3 e3) {
|
||||
int a = c1.b; // Error
|
||||
int b = c1.c; // Error
|
||||
int c = c2.b; // Error
|
||||
int d = c2.c; // Error
|
||||
int e = c3.b; // Error
|
||||
int f = c3.c; // Error
|
||||
int g = e1.a; // Error
|
||||
int h = e2.a; // Error
|
||||
int i = e3.a; // Error
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:6:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:7:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:8:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:12:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:13:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:14:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:18:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:19:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:20:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:30:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int a = c1.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:31:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int b = c1.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:32:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int c = c2.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:33:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = c2.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:34:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = c3.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:35:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c3.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:36:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int g = e1.a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:37:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int h = e2.a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:38:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int i = e3.a; // Error
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class C1 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •(core::Object? a, core::Object? b, final core::Object? c) → self::C1
|
||||
: self::C1::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:6:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C1::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:7:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C1::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:8:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C1::b = b, self::C1::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C2 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •([has-declared-initializer core::Object? a = #C1, has-declared-initializer core::Object? b = #C1, final has-declared-initializer core::Object? c = #C1]) → self::C2
|
||||
: self::C2::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:12:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C2::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:13:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C2::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:14:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C2::b = b, self::C2::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C3 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •({has-declared-initializer core::Object? a = #C1, has-declared-initializer core::Object? b = #C1, final has-declared-initializer core::Object? c = #C1}) → self::C3
|
||||
: self::C3::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:18:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C3::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:19:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C3::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:20:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C3::b = b, self::C3::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
extension type ET1(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET1|constructor#;
|
||||
constructor tearoff • = self::ET1|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET2(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET2|constructor#;
|
||||
constructor tearoff • = self::ET2|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET3(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET3|constructor#;
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET1|constructor#(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET1% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET1|constructor#_#new#tearOff(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */
|
||||
return self::ET1|constructor#(a);
|
||||
static extension-type-member method ET2|constructor#([has-declared-initializer core::Object? a = #C1]) → self::ET2% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET2% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET2|constructor#_#new#tearOff([has-declared-initializer core::Object? a = #C1]) → self::ET2% /* erasure=dynamic, declared=! */
|
||||
return self::ET2|constructor#(a);
|
||||
static extension-type-member method ET3|constructor#({has-declared-initializer core::Object? a = #C1}) → self::ET3% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET3% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff({has-declared-initializer core::Object? a = #C1}) → self::ET3% /* erasure=dynamic, declared=! */
|
||||
return self::ET3|constructor#(a: a);
|
||||
static method test(self::C1 c1, self::C2 c2, self::C3 c3, self::ET1% /* erasure=dynamic, declared=! */ e1, self::ET2% /* erasure=dynamic, declared=! */ e2, self::ET3% /* erasure=dynamic, declared=! */ e3) → dynamic {
|
||||
core::int a = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:30:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int a = c1.b; // Error
|
||||
^" in c1.{self::C1::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int b = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:31:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int b = c1.c; // Error
|
||||
^" in c1.{self::C1::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int c = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:32:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int c = c2.b; // Error
|
||||
^" in c2.{self::C2::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:33:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = c2.c; // Error
|
||||
^" in c2.{self::C2::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:34:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = c3.b; // Error
|
||||
^" in c3.{self::C3::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:35:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c3.c; // Error
|
||||
^" in c3.{self::C3::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int g = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:36:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int g = e1.a; // Error
|
||||
^" in (e1 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
core::int h = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:37:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int h = e2.a; // Error
|
||||
^" in (e2 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
core::int i = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:38:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int i = e3.a; // Error
|
||||
^" in (e3 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
}
|
||||
|
||||
constants {
|
||||
#C1 = null
|
||||
}
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:6:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:7:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:8:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:12:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:13:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:14:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:18:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:19:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:20:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:30:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int a = c1.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:31:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int b = c1.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:32:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int c = c2.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:33:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = c2.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:34:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = c3.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:35:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c3.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:36:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int g = e1.a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:37:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int h = e2.a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:38:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int i = e3.a; // Error
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class C1 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •(core::Object? a, core::Object? b, final core::Object? c) → self::C1
|
||||
: self::C1::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:6:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C1::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:7:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C1::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:8:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C1::b = b, self::C1::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C2 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •([has-declared-initializer core::Object? a = #C1, has-declared-initializer core::Object? b = #C1, final has-declared-initializer core::Object? c = #C1]) → self::C2
|
||||
: self::C2::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:12:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C2::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:13:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C2::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:14:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C2::b = b, self::C2::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C3 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •({has-declared-initializer core::Object? a = #C1, has-declared-initializer core::Object? b = #C1, final has-declared-initializer core::Object? c = #C1}) → self::C3
|
||||
: self::C3::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:18:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C3::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:19:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C3::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:20:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C3::b = b, self::C3::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
extension type ET1(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET1|constructor#;
|
||||
constructor tearoff • = self::ET1|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET2(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET2|constructor#;
|
||||
constructor tearoff • = self::ET2|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET3(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET3|constructor#;
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET1|constructor#(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET1% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET1|constructor#_#new#tearOff(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */
|
||||
return self::ET1|constructor#(a);
|
||||
static extension-type-member method ET2|constructor#([has-declared-initializer core::Object? a = #C1]) → self::ET2% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET2% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET2|constructor#_#new#tearOff([has-declared-initializer core::Object? a = #C1]) → self::ET2% /* erasure=dynamic, declared=! */
|
||||
return self::ET2|constructor#(a);
|
||||
static extension-type-member method ET3|constructor#({has-declared-initializer core::Object? a = #C1}) → self::ET3% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET3% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff({has-declared-initializer core::Object? a = #C1}) → self::ET3% /* erasure=dynamic, declared=! */
|
||||
return self::ET3|constructor#(a: a);
|
||||
static method test(self::C1 c1, self::C2 c2, self::C3 c3, self::ET1% /* erasure=dynamic, declared=! */ e1, self::ET2% /* erasure=dynamic, declared=! */ e2, self::ET3% /* erasure=dynamic, declared=! */ e3) → dynamic {
|
||||
core::int a = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:30:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int a = c1.b; // Error
|
||||
^" in c1.{self::C1::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int b = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:31:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int b = c1.c; // Error
|
||||
^" in c1.{self::C1::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int c = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:32:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int c = c2.b; // Error
|
||||
^" in c2.{self::C2::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:33:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = c2.c; // Error
|
||||
^" in c2.{self::C2::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:34:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = c3.b; // Error
|
||||
^" in c3.{self::C3::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:35:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c3.c; // Error
|
||||
^" in c3.{self::C3::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int g = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:36:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int g = e1.a; // Error
|
||||
^" in (e1 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
core::int h = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:37:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int h = e2.a; // Error
|
||||
^" in (e2 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
core::int i = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:38:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int i = e3.a; // Error
|
||||
^" in (e3 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
}
|
||||
|
||||
constants {
|
||||
#C1 = null
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class C1 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •(core::Object? a, core::Object? b, final core::Object? c) → self::C1
|
||||
;
|
||||
}
|
||||
class C2 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •([has-declared-initializer core::Object? a = null, has-declared-initializer core::Object? b = null, final has-declared-initializer core::Object? c = null]) → self::C2
|
||||
;
|
||||
}
|
||||
class C3 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •({has-declared-initializer core::Object? a = null, has-declared-initializer core::Object? b = null, final has-declared-initializer core::Object? c = null}) → self::C3
|
||||
;
|
||||
}
|
||||
extension type ET1(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET1|constructor#;
|
||||
constructor tearoff • = self::ET1|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET2(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET2|constructor#;
|
||||
constructor tearoff • = self::ET2|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET3(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET3|constructor#;
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET1|constructor#(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method ET1|constructor#_#new#tearOff(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */
|
||||
return self::ET1|constructor#(a);
|
||||
static extension-type-member method ET2|constructor#([has-declared-initializer core::Object? a = null]) → self::ET2% /* erasure=dynamic, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method ET2|constructor#_#new#tearOff([has-declared-initializer core::Object? a]) → self::ET2% /* erasure=dynamic, declared=! */
|
||||
return self::ET2|constructor#(a);
|
||||
static extension-type-member method ET3|constructor#({has-declared-initializer core::Object? a = null}) → self::ET3% /* erasure=dynamic, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff({has-declared-initializer core::Object? a}) → self::ET3% /* erasure=dynamic, declared=! */
|
||||
return self::ET3|constructor#(a: a);
|
||||
static method test(self::C1 c1, self::C2 c2, self::C3 c3, self::ET1% /* erasure=dynamic, declared=! */ e1, self::ET2% /* erasure=dynamic, declared=! */ e2, self::ET3% /* erasure=dynamic, declared=! */ e3) → dynamic
|
||||
;
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:6:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:7:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:8:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:12:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:13:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:14:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:18:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:19:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:20:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:30:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int a = c1.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:31:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int b = c1.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:32:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int c = c2.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:33:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int d = c2.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:34:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int e = c3.b; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:35:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int f = c3.c; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:36:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int g = e1.a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:37:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int h = e2.a; // Error
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/primary_constructors/inferred_type.dart:38:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// int i = e3.a; // Error
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class C1 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •(core::Object? a, core::Object? b, final core::Object? c) → self::C1
|
||||
: self::C1::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:6:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C1::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:7:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C1::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:8:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C1::b = b, self::C1::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C2 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •([has-declared-initializer core::Object? a = #C1, has-declared-initializer core::Object? b = #C1, final has-declared-initializer core::Object? c = #C1]) → self::C2
|
||||
: self::C2::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:12:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C2::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:13:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C2::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:14:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C2::b = b, self::C2::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C3 extends core::Object {
|
||||
field core::Object? b;
|
||||
final field core::Object? c;
|
||||
field core::int d;
|
||||
field core::int e;
|
||||
field core::int f;
|
||||
constructor •({has-declared-initializer core::Object? a = #C1, has-declared-initializer core::Object? b = #C1, final has-declared-initializer core::Object? c = #C1}) → self::C3
|
||||
: self::C3::d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:18:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = a; // Error
|
||||
^" in a as{TypeError} core::int, self::C3::e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:19:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = b; // Error
|
||||
^" in b as{TypeError} core::int, self::C3::f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:20:11: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c; // Error
|
||||
^" in c as{TypeError} core::int, self::C3::b = b, self::C3::c = c, super core::Object::•()
|
||||
;
|
||||
}
|
||||
extension type ET1(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET1|constructor#;
|
||||
constructor tearoff • = self::ET1|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET2(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET2|constructor#;
|
||||
constructor tearoff • = self::ET2|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET3(dynamic a) {
|
||||
abstract extension-type-member representation-field get a() → core::Object?;
|
||||
constructor • = self::ET3|constructor#;
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
static extension-type-member method ET1|constructor#(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET1% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET1|constructor#_#new#tearOff(core::Object? a) → self::ET1% /* erasure=dynamic, declared=! */
|
||||
return self::ET1|constructor#(a);
|
||||
static extension-type-member method ET2|constructor#([has-declared-initializer core::Object? a = #C1]) → self::ET2% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET2% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET2|constructor#_#new#tearOff([has-declared-initializer core::Object? a = #C1]) → self::ET2% /* erasure=dynamic, declared=! */
|
||||
return self::ET2|constructor#(a);
|
||||
static extension-type-member method ET3|constructor#({has-declared-initializer core::Object? a = #C1}) → self::ET3% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET3% /* erasure=dynamic, declared=! */ #this = a;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff({has-declared-initializer core::Object? a = #C1}) → self::ET3% /* erasure=dynamic, declared=! */
|
||||
return self::ET3|constructor#(a: a);
|
||||
static method test(self::C1 c1, self::C2 c2, self::C3 c3, self::ET1% /* erasure=dynamic, declared=! */ e1, self::ET2% /* erasure=dynamic, declared=! */ e2, self::ET3% /* erasure=dynamic, declared=! */ e3) → dynamic {
|
||||
core::int a = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:30:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int a = c1.b; // Error
|
||||
^" in c1.{self::C1::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int b = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:31:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int b = c1.c; // Error
|
||||
^" in c1.{self::C1::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int c = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:32:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int c = c2.b; // Error
|
||||
^" in c2.{self::C2::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int d = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:33:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int d = c2.c; // Error
|
||||
^" in c2.{self::C2::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int e = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:34:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int e = c3.b; // Error
|
||||
^" in c3.{self::C3::b}{core::Object?} as{TypeError} core::int;
|
||||
core::int f = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:35:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int f = c3.c; // Error
|
||||
^" in c3.{self::C3::c}{core::Object?} as{TypeError} core::int;
|
||||
core::int g = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:36:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int g = e1.a; // Error
|
||||
^" in (e1 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
core::int h = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:37:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int h = e2.a; // Error
|
||||
^" in (e2 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
core::int i = invalid-expression "pkg/front_end/testcases/primary_constructors/inferred_type.dart:38:14: Error: A value of type 'Object?' can't be assigned to a variable of type 'int'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
int i = e3.a; // Error
|
||||
^" in (e3 as{Unchecked} core::Object?) as{TypeError} core::int;
|
||||
}
|
||||
|
||||
constants {
|
||||
#C1 = null
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
class C1(a, var b, final c) {
|
||||
int d = a;
|
||||
int e = b;
|
||||
int f = c;
|
||||
}
|
||||
|
||||
class C2([a = null, var b = null, final c = null]) {
|
||||
int d = a;
|
||||
int e = b;
|
||||
int f = c;
|
||||
}
|
||||
|
||||
class C3({a = null, var b = null, final c = null}) {
|
||||
int d = a;
|
||||
int e = b;
|
||||
int f = c;
|
||||
}
|
||||
|
||||
extension type ET1(a);
|
||||
|
||||
extension type ET2([a = null]);
|
||||
|
||||
extension type ET3({a = null});
|
||||
|
||||
test(C1 c1, C2 c2, C3 c3, ET1 e1, ET2 e2, ET3 e3) {}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
class C1(a, var b, final c) {
|
||||
int d = a;
|
||||
int e = b;
|
||||
int f = c;
|
||||
}
|
||||
|
||||
class C2([a = null, var b = null, final c = null]) {
|
||||
int d = a;
|
||||
int e = b;
|
||||
int f = c;
|
||||
}
|
||||
|
||||
class C3({a = null, var b = null, final c = null}) {
|
||||
int d = a;
|
||||
int e = b;
|
||||
int f = c;
|
||||
}
|
||||
|
||||
extension type ET1(a);
|
||||
|
||||
extension type ET2([a = null]);
|
||||
|
||||
extension type ET3({a = null});
|
||||
|
||||
test(C1 c1, C2 c2, C3 c3, ET1 e1, ET2 e2, ET3 e3) {}
|
||||
+2
-2
@@ -47,12 +47,12 @@ class C3 extends core::Object {
|
||||
;
|
||||
}
|
||||
class C4 extends core::Object {
|
||||
constructor •([dynamic e = #C1]) → self::C4
|
||||
constructor •([core::Object? e = #C1]) → self::C4
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C5 extends core::Object {
|
||||
constructor •({dynamic f = #C2}) → self::C5
|
||||
constructor •({core::Object? f = #C2}) → self::C5
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
|
||||
+2
-2
@@ -47,12 +47,12 @@ class C3 extends core::Object {
|
||||
;
|
||||
}
|
||||
class C4 extends core::Object {
|
||||
constructor •([dynamic e = #C1]) → self::C4
|
||||
constructor •([core::Object? e = #C1]) → self::C4
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C5 extends core::Object {
|
||||
constructor •({dynamic f = #C2}) → self::C5
|
||||
constructor •({core::Object? f = #C2}) → self::C5
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
|
||||
+2
-2
@@ -23,11 +23,11 @@ class C3 extends core::Object {
|
||||
;
|
||||
}
|
||||
class C4 extends core::Object {
|
||||
constructor •([dynamic e = 0]) → self::C4
|
||||
constructor •([core::Object? e = 0]) → self::C4
|
||||
;
|
||||
}
|
||||
class C5 extends core::Object {
|
||||
constructor •({dynamic f = true}) → self::C5
|
||||
constructor •({core::Object? f = true}) → self::C5
|
||||
;
|
||||
}
|
||||
static method test() → dynamic
|
||||
|
||||
+2
-2
@@ -47,12 +47,12 @@ class C3 extends core::Object {
|
||||
;
|
||||
}
|
||||
class C4 extends core::Object {
|
||||
constructor •([dynamic e = #C1]) → self::C4
|
||||
constructor •([core::Object? e = #C1]) → self::C4
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C5 extends core::Object {
|
||||
constructor •({dynamic f = #C2}) → self::C5
|
||||
constructor •({core::Object? f = #C2}) → self::C5
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
|
||||
+9
-9
@@ -29,17 +29,17 @@ extension type ET3(core::int i) {
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET4(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET4|constructor#;
|
||||
constructor tearoff • = self::ET4|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET5(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET5|constructor#;
|
||||
constructor tearoff • = self::ET5|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET6(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET6|constructor#;
|
||||
constructor tearoff • = self::ET6|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -61,21 +61,21 @@ static extension-type-member method ET3|constructor#(final core::int i) → self
|
||||
}
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff(core::int i) → self::ET3% /* erasure=core::int, declared=! */
|
||||
return self::ET3|constructor#(i);
|
||||
static extension-type-member method ET4|constructor#(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET4|constructor#(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET4% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
return self::ET4|constructor#(i);
|
||||
static extension-type-member method ET5|constructor#(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET5|constructor#(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET5% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
return self::ET5|constructor#(i);
|
||||
static extension-type-member method ET6|constructor#(final dynamic i) → self::ET6% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET6|constructor#(final core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET6% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(dynamic i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
return self::ET6|constructor#(i);
|
||||
|
||||
+9
-9
@@ -29,17 +29,17 @@ extension type ET3(core::int i) {
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET4(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET4|constructor#;
|
||||
constructor tearoff • = self::ET4|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET5(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET5|constructor#;
|
||||
constructor tearoff • = self::ET5|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET6(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET6|constructor#;
|
||||
constructor tearoff • = self::ET6|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -61,21 +61,21 @@ static extension-type-member method ET3|constructor#(final core::int i) → self
|
||||
}
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff(core::int i) → self::ET3% /* erasure=core::int, declared=! */
|
||||
return self::ET3|constructor#(i);
|
||||
static extension-type-member method ET4|constructor#(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET4|constructor#(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET4% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
return self::ET4|constructor#(i);
|
||||
static extension-type-member method ET5|constructor#(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET5|constructor#(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET5% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
return self::ET5|constructor#(i);
|
||||
static extension-type-member method ET6|constructor#(final dynamic i) → self::ET6% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET6|constructor#(final core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET6% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(dynamic i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
return self::ET6|constructor#(i);
|
||||
|
||||
+9
-9
@@ -29,17 +29,17 @@ extension type ET3(core::int i) {
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET4(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET4|constructor#;
|
||||
constructor tearoff • = self::ET4|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET5(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET5|constructor#;
|
||||
constructor tearoff • = self::ET5|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET6(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET6|constructor#;
|
||||
constructor tearoff • = self::ET6|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -55,15 +55,15 @@ static extension-type-member method ET3|constructor#(final core::int i) → self
|
||||
;
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff(core::int i) → self::ET3% /* erasure=core::int, declared=! */
|
||||
return self::ET3|constructor#(i);
|
||||
static extension-type-member method ET4|constructor#(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member method ET4|constructor#(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
return self::ET4|constructor#(i);
|
||||
static extension-type-member method ET5|constructor#(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member method ET5|constructor#(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
return self::ET5|constructor#(i);
|
||||
static extension-type-member method ET6|constructor#(final dynamic i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member method ET6|constructor#(final core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
;
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(dynamic i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
return self::ET6|constructor#(i);
|
||||
|
||||
+9
-9
@@ -29,17 +29,17 @@ extension type ET3(core::int i) {
|
||||
constructor tearoff • = self::ET3|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET4(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET4|constructor#;
|
||||
constructor tearoff • = self::ET4|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET5(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET5|constructor#;
|
||||
constructor tearoff • = self::ET5|constructor#_#new#tearOff;
|
||||
}
|
||||
extension type ET6(dynamic i) {
|
||||
abstract extension-type-member representation-field get i() → dynamic;
|
||||
abstract extension-type-member representation-field get i() → core::Object?;
|
||||
constructor • = self::ET6|constructor#;
|
||||
constructor tearoff • = self::ET6|constructor#_#new#tearOff;
|
||||
}
|
||||
@@ -61,21 +61,21 @@ static extension-type-member method ET3|constructor#(final core::int i) → self
|
||||
}
|
||||
static extension-type-member synthetic method ET3|constructor#_#new#tearOff(core::int i) → self::ET3% /* erasure=core::int, declared=! */
|
||||
return self::ET3|constructor#(i);
|
||||
static extension-type-member method ET4|constructor#(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET4|constructor#(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET4% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(dynamic i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET4|constructor#_#new#tearOff(core::Object? i) → self::ET4% /* erasure=dynamic, declared=! */
|
||||
return self::ET4|constructor#(i);
|
||||
static extension-type-member method ET5|constructor#(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET5|constructor#(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET5% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(dynamic i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET5|constructor#_#new#tearOff(core::Object? i) → self::ET5% /* erasure=dynamic, declared=! */
|
||||
return self::ET5|constructor#(i);
|
||||
static extension-type-member method ET6|constructor#(final dynamic i) → self::ET6% /* erasure=dynamic, declared=! */ {
|
||||
static extension-type-member method ET6|constructor#(final core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */ {
|
||||
lowered final self::ET6% /* erasure=dynamic, declared=! */ #this = i;
|
||||
return #this;
|
||||
}
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(dynamic i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
static extension-type-member synthetic method ET6|constructor#_#new#tearOff(core::Object? i) → self::ET6% /* erasure=dynamic, declared=! */
|
||||
return self::ET6|constructor#(i);
|
||||
|
||||
Reference in New Issue
Block a user