Reland "[fasta] Report errors for bounds violations"

The original commit:
aa6fb2d3a4

Change-Id: I34287ec856fde16d56e9369ef2620311ba9bb722
Reviewed-on: https://dart-review.googlesource.com/c/79200
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
Dmitry Stefantsov 2018-10-11 10:20:01 +00:00 committed by commit-bot@chromium.org
parent 5c9a8d8cb5
commit 8648d782ae
51 changed files with 1607 additions and 456 deletions

View file

@ -4,7 +4,7 @@
library fasta.dill_typedef_builder;
import 'package:kernel/ast.dart' show DartType, Typedef;
import 'package:kernel/ast.dart' show DartType, FunctionType, Typedef;
import '../kernel/kernel_builder.dart'
show
@ -36,7 +36,17 @@ class DillFunctionTypeAliasBuilder extends KernelFunctionTypeAliasBuilder {
}
@override
DartType buildThisType(LibraryBuilder library) => thisType ??= target.type;
DartType buildThisType(LibraryBuilder library) {
if (thisType != null) return thisType;
DartType targetType = target.type;
if (targetType is FunctionType) {
// TODO(34655): The line below is a workaround. Find the place where the
// reference is lost and fix it.
targetType.typedefReference = target.reference;
}
return thisType = targetType;
}
@override
List<DartType> buildTypeArguments(

View file

@ -674,41 +674,6 @@ const MessageCode messageCantUsePrefixWithNullAware = const MessageCode(
message: r"""A prefix can't be used with null-aware operators.""",
tip: r"""It should be safe to remove the '?' as a prefix is never null.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(DartType _type)>
templateCantUseSuperBoundedTypeForInstanceCreation =
const Template<Message Function(DartType _type)>(
messageTemplate:
r"""Can't use a super-bounded type for instance creation. Got '#type'.""",
tipTemplate:
r"""Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.""",
withArguments:
_withArgumentsCantUseSuperBoundedTypeForInstanceCreation);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(DartType _type)>
codeCantUseSuperBoundedTypeForInstanceCreation =
const Code<Message Function(DartType _type)>(
"CantUseSuperBoundedTypeForInstanceCreation",
templateCantUseSuperBoundedTypeForInstanceCreation,
);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsCantUseSuperBoundedTypeForInstanceCreation(
DartType _type) {
NameSystem nameSystem = new NameSystem();
StringBuffer buffer;
buffer = new StringBuffer();
new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
String type = '$buffer';
return new Message(codeCantUseSuperBoundedTypeForInstanceCreation,
message:
"""Can't use a super-bounded type for instance creation. Got '${type}'.""",
tip: """Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.""",
arguments: {'type': _type});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeCatchSyntax = messageCatchSyntax;
@ -4106,6 +4071,229 @@ Message _withArgumentsImportHidesImport(String name, Uri uri_, Uri uri2_) {
arguments: {'name': name, 'uri': uri_, 'uri2': uri2_});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
DartType _type,
String
name)> templateIncorrectTypeArgument = const Template<
Message Function(DartType _type, String name)>(
messageTemplate:
r"""Type argument '#type' violates the corresponding type variable bound of '#name'.""",
tipTemplate:
r"""Try changing type arguments so that they conform to the bounds.""",
withArguments: _withArgumentsIncorrectTypeArgument);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(DartType _type, String name)>
codeIncorrectTypeArgument =
const Code<Message Function(DartType _type, String name)>(
"IncorrectTypeArgument", templateIncorrectTypeArgument,
analyzerCodes: <String>["TYPE_ARGUMENT_NOT_MATCHING_BOUNDS"]);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsIncorrectTypeArgument(DartType _type, String name) {
NameSystem nameSystem = new NameSystem();
StringBuffer buffer;
buffer = new StringBuffer();
new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
String type = '$buffer';
if (name.isEmpty) throw 'No name provided';
name = demangleMixinApplicationName(name);
return new Message(codeIncorrectTypeArgument,
message:
"""Type argument '${type}' violates the corresponding type variable bound of '${name}'.""",
tip: """Try changing type arguments so that they conform to the bounds.""",
arguments: {'type': _type, 'name': name});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
DartType _type,
String
name)> templateIncorrectTypeArgumentInReturnType = const Template<
Message Function(DartType _type, String name)>(
messageTemplate:
r"""Type argument '#type' violates the corresponding type variable bound of '#name' in the return type.""",
tipTemplate:
r"""Try changing type arguments so that they conform to the bounds.""",
withArguments: _withArgumentsIncorrectTypeArgumentInReturnType);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(DartType _type, String name)>
codeIncorrectTypeArgumentInReturnType =
const Code<Message Function(DartType _type, String name)>(
"IncorrectTypeArgumentInReturnType",
templateIncorrectTypeArgumentInReturnType,
analyzerCodes: <String>["TYPE_ARGUMENT_NOT_MATCHING_BOUNDS"]);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsIncorrectTypeArgumentInReturnType(
DartType _type, String name) {
NameSystem nameSystem = new NameSystem();
StringBuffer buffer;
buffer = new StringBuffer();
new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
String type = '$buffer';
if (name.isEmpty) throw 'No name provided';
name = demangleMixinApplicationName(name);
return new Message(codeIncorrectTypeArgumentInReturnType,
message:
"""Type argument '${type}' violates the corresponding type variable bound of '${name}' in the return type.""",
tip: """Try changing type arguments so that they conform to the bounds.""",
arguments: {'type': _type, 'name': name});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
DartType _type,
String name,
String name2,
String
name3)> templateIncorrectTypeArgumentInSupertype = const Template<
Message Function(
DartType _type, String name, String name2, String name3)>(
messageTemplate:
r"""Type argument '#type' violates the corresponding type variable bound of '#name' in the supertype '#name2' of class '#name3'.""",
tipTemplate:
r"""Try changing type arguments so that they conform to the bounds.""",
withArguments: _withArgumentsIncorrectTypeArgumentInSupertype);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<
Message Function(
DartType _type, String name, String name2, String name3)>
codeIncorrectTypeArgumentInSupertype = const Code<
Message Function(
DartType _type, String name, String name2, String name3)>(
"IncorrectTypeArgumentInSupertype",
templateIncorrectTypeArgumentInSupertype,
analyzerCodes: <String>["TYPE_ARGUMENT_NOT_MATCHING_BOUNDS"]);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsIncorrectTypeArgumentInSupertype(
DartType _type, String name, String name2, String name3) {
NameSystem nameSystem = new NameSystem();
StringBuffer buffer;
buffer = new StringBuffer();
new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
String type = '$buffer';
if (name.isEmpty) throw 'No name provided';
name = demangleMixinApplicationName(name);
if (name2.isEmpty) throw 'No name provided';
name2 = demangleMixinApplicationName(name2);
if (name3.isEmpty) throw 'No name provided';
name3 = demangleMixinApplicationName(name3);
return new Message(codeIncorrectTypeArgumentInSupertype,
message:
"""Type argument '${type}' violates the corresponding type variable bound of '${name}' in the supertype '${name2}' of class '${name3}'.""",
tip: """Try changing type arguments so that they conform to the bounds.""",
arguments: {'type': _type, 'name': name, 'name2': name2, 'name3': name3});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
DartType _type,
String name,
String name2,
String
name3)> templateIncorrectTypeArgumentInSupertypeInferred = const Template<
Message Function(DartType _type, String name, String name2,
String name3)>(
messageTemplate:
r"""Inferred type argument '#type' violates the corresponding type variable bound of '#name' in the supertype '#name2' of class '#name3'.""",
tipTemplate:
r"""Try specifying type arguments explicitly so that they conform to the bounds.""",
withArguments: _withArgumentsIncorrectTypeArgumentInSupertypeInferred);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<
Message Function(
DartType _type, String name, String name2, String name3)>
codeIncorrectTypeArgumentInSupertypeInferred = const Code<
Message Function(
DartType _type, String name, String name2, String name3)>(
"IncorrectTypeArgumentInSupertypeInferred",
templateIncorrectTypeArgumentInSupertypeInferred,
analyzerCodes: <String>["TYPE_ARGUMENT_NOT_MATCHING_BOUNDS"]);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsIncorrectTypeArgumentInSupertypeInferred(
DartType _type, String name, String name2, String name3) {
NameSystem nameSystem = new NameSystem();
StringBuffer buffer;
buffer = new StringBuffer();
new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
String type = '$buffer';
if (name.isEmpty) throw 'No name provided';
name = demangleMixinApplicationName(name);
if (name2.isEmpty) throw 'No name provided';
name2 = demangleMixinApplicationName(name2);
if (name3.isEmpty) throw 'No name provided';
name3 = demangleMixinApplicationName(name3);
return new Message(codeIncorrectTypeArgumentInSupertypeInferred,
message:
"""Inferred type argument '${type}' violates the corresponding type variable bound of '${name}' in the supertype '${name2}' of class '${name3}'.""",
tip: """Try specifying type arguments explicitly so that they conform to the bounds.""",
arguments: {'type': _type, 'name': name, 'name2': name2, 'name3': name3});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
DartType _type,
String
name)> templateIncorrectTypeArgumentInferred = const Template<
Message Function(DartType _type,
String name)>(
messageTemplate:
r"""Inferred type argument '#type' violates the corresponding type variable bound of '#name'.""",
tipTemplate:
r"""Try specifying type arguments explicitly so that they conform to the bounds.""",
withArguments: _withArgumentsIncorrectTypeArgumentInferred);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(DartType _type, String name)>
codeIncorrectTypeArgumentInferred =
const Code<Message Function(DartType _type, String name)>(
"IncorrectTypeArgumentInferred", templateIncorrectTypeArgumentInferred,
analyzerCodes: <String>["TYPE_ARGUMENT_NOT_MATCHING_BOUNDS"]);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsIncorrectTypeArgumentInferred(
DartType _type, String name) {
NameSystem nameSystem = new NameSystem();
StringBuffer buffer;
buffer = new StringBuffer();
new Printer(buffer, syntheticNames: nameSystem).writeNode(_type);
String type = '$buffer';
if (name.isEmpty) throw 'No name provided';
name = demangleMixinApplicationName(name);
return new Message(codeIncorrectTypeArgumentInferred,
message:
"""Inferred type argument '${type}' violates the corresponding type variable bound of '${name}'.""",
tip: """Try specifying type arguments explicitly so that they conform to the bounds.""",
arguments: {'type': _type, 'name': name});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeIncorrectTypeArgumentVariable =
messageIncorrectTypeArgumentVariable;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageIncorrectTypeArgumentVariable = const MessageCode(
"IncorrectTypeArgumentVariable",
severity: Severity.context,
message: r"""Bound of this variable is violated.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeInheritedMembersConflict = messageInheritedMembersConflict;

View file

@ -214,6 +214,11 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
/// invocations are to be resolved in a separate step.
final List<Expression> redirectingFactoryInvocations = <Expression>[];
/// In some cases checks of the type arguments in method invocations can't be
/// done right away, because some type arguments within the receiver
/// expression are yet to be inferred.
final List<MethodInvocation> delayedBoundsChecks = <MethodInvocation>[];
BodyBuilder(
this.library,
this.member,
@ -267,6 +272,8 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
return isInstanceMember || member is KernelConstructorBuilder;
}
TypeEnvironment get typeEnvironment => _typeInferrer?.typeSchemaEnvironment;
@override
void push(Object node) {
if (node is DartType) {
@ -555,6 +562,11 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
}
resolveRedirectingFactoryTargets();
for (MethodInvocation node in delayedBoundsChecks) {
library.checkBoundsInMethodInvocation(
node, classBuilder?.target, typeEnvironment);
}
delayedBoundsChecks.clear();
}
@override
@ -717,9 +729,9 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
// enabled for two reasons:
// 1) the [isSubtypeOf] predicate produces false-negatives when [strongMode]
// is false.
// 2) the member [_typeInferrer.typeSchemaEnvironment] might be null when
// [strongMode] is false. This particular behaviour can be observed when
// running the fasta perf benchmarks.
// 2) the member [typeEnvironment] might be null when [strongMode] is false.
// This particular behaviour can be observed when running the fasta perf
// benchmarks.
bool strongMode = library.loader.target.strongMode;
if (strongMode && builder.returnType != null) {
DartType returnType = builder.function.returnType;
@ -733,8 +745,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
switch (asyncModifier) {
case AsyncMarker.Async:
DartType futureBottomType = library.loader.futureOfBottom;
if (!_typeInferrer.typeSchemaEnvironment
.isSubtypeOf(futureBottomType, returnType)) {
if (!typeEnvironment.isSubtypeOf(futureBottomType, returnType)) {
problem = fasta.messageIllegalAsyncReturnType;
}
break;
@ -743,8 +754,8 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
DartType streamBottomType = library.loader.streamOfBottom;
if (returnType is VoidType) {
problem = fasta.messageIllegalAsyncGeneratorVoidReturnType;
} else if (!_typeInferrer.typeSchemaEnvironment
.isSubtypeOf(streamBottomType, returnType)) {
} else if (!typeEnvironment.isSubtypeOf(
streamBottomType, returnType)) {
problem = fasta.messageIllegalAsyncGeneratorReturnType;
}
break;
@ -753,8 +764,8 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
DartType iterableBottomType = library.loader.iterableOfBottom;
if (returnType is VoidType) {
problem = fasta.messageIllegalSyncGeneratorVoidReturnType;
} else if (!_typeInferrer.typeSchemaEnvironment
.isSubtypeOf(iterableBottomType, returnType)) {
} else if (!typeEnvironment.isSubtypeOf(
iterableBottomType, returnType)) {
problem = fasta.messageIllegalSyncGeneratorReturnType;
}
break;
@ -832,6 +843,11 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
}
resolveRedirectingFactoryTargets();
for (MethodInvocation node in delayedBoundsChecks) {
library.checkBoundsInMethodInvocation(
node, classBuilder?.target, typeEnvironment);
}
delayedBoundsChecks.clear();
}
void resolveRedirectingFactoryTargets() {
@ -1954,14 +1970,17 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
bool isConst = (currentLocalVariableModifiers & constMask) != 0;
bool isFinal = (currentLocalVariableModifiers & finalMask) != 0;
assert(isConst == (constantContext == ConstantContext.inferred));
push(new VariableDeclarationJudgment(identifier.name, functionNestingLevel,
VariableDeclaration variable = new VariableDeclarationJudgment(
identifier.name, functionNestingLevel,
forSyntheticToken: deprecated_extractToken(identifier).isSynthetic,
initializer: initializer,
type: buildDartType(currentLocalVariableType),
isFinal: isFinal,
isConst: isConst)
..fileOffset = identifier.charOffset
..fileEqualsOffset = offsetForToken(equalsToken));
..fileEqualsOffset = offsetForToken(equalsToken);
library.checkBoundsInVariableDeclaration(variable, typeEnvironment);
push(variable);
}
@override
@ -2231,14 +2250,16 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
}
}
}
push(forest.literalList(
Expression node = forest.literalList(
constKeyword,
constKeyword != null || constantContext == ConstantContext.inferred,
typeArgument,
typeArguments,
leftBracket,
expressions,
rightBracket));
rightBracket);
library.checkBoundsInListLiteral(node, typeEnvironment);
push(node);
}
@override
@ -2285,8 +2306,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
}
}
}
push(forest.literalMap(
Expression node = forest.literalMap(
constKeyword,
constKeyword != null || constantContext == ConstantContext.inferred,
keyType,
@ -2294,7 +2314,9 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
typeArguments,
leftBrace,
entries,
rightBrace));
rightBrace);
library.checkBoundsInMapLiteral(node, typeEnvironment);
push(node);
}
@override
@ -2448,7 +2470,8 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
@override
void handleAsOperator(Token operator) {
debugEvent("AsOperator");
UnresolvedType<KernelTypeBuilder> type = pop();
DartType type = buildDartType(pop());
library.checkBoundsInType(type, typeEnvironment, operator.charOffset);
Expression expression = popForValue();
if (constantContext != ConstantContext.none) {
push(buildProblem(
@ -2458,7 +2481,8 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
operator.length)
.desugared);
} else {
push(forest.asExpression(expression, buildDartType(type), operator));
Expression node = forest.asExpression(expression, type, operator);
push(node);
}
}
@ -2470,6 +2494,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
bool isInverted = not != null;
Expression isExpression =
forest.isExpression(operand, isOperator, not, type);
library.checkBoundsInType(type, typeEnvironment, isOperator.charOffset);
if (operand is VariableGet) {
typePromoter.handleIsCheck(isExpression, isInverted, operand.variable,
type, functionNestingLevel);
@ -3032,10 +3057,12 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
target,
arguments);
}
return new ConstructorInvocationJudgment(
ConstructorInvocation node = new ConstructorInvocationJudgment(
target, forest.castArguments(arguments),
isConst: isConst)
..fileOffset = charOffset;
library.checkBoundsInConstructorInvocation(node, typeEnvironment);
return node;
} else {
Procedure procedure = target;
if (procedure.isFactory) {
@ -3049,15 +3076,19 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
target,
arguments);
}
return new FactoryConstructorInvocationJudgment(
StaticInvocation node = FactoryConstructorInvocationJudgment(
target, forest.castArguments(arguments),
isConst: isConst)
..fileOffset = charOffset;
library.checkBoundsInFactoryInvocation(node, typeEnvironment);
return node;
} else {
return new StaticInvocationJudgment(
StaticInvocation node = new StaticInvocationJudgment(
target, forest.castArguments(arguments),
desugaredError: error, isConst: isConst)
..fileOffset = charOffset;
library.checkBoundsInStaticInvocation(node, typeEnvironment);
return node;
}
}
}
@ -3095,10 +3126,13 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
List<DartType> types = forest.argumentsTypeArguments(arguments);
if (typeParameters.length != types.length) {
if (types.length == 0) {
// Expected `typeParameters.length` type arguments, but none given,
// so we fill in dynamic.
for (int i = 0; i < typeParameters.length; i++) {
types.add(const DynamicType());
// Expected `typeParameters.length` type arguments, but none given, so
// we fill in dynamic in legacy mode, and use type inference in strong
// mode.
if (!library.loader.target.strongMode) {
for (int i = 0; i < typeParameters.length; i++) {
types.add(const DynamicType());
}
}
} else {
// A wrong (non-zero) amount of type arguments given. That's an error.
@ -4326,8 +4360,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
} else {
if (library.loader.target.strongMode &&
formalType != null &&
!_typeInferrer.typeSchemaEnvironment
.isSubtypeOf(formalType, builder.field.type)) {
!typeEnvironment.isSubtypeOf(formalType, builder.field.type)) {
library.addProblem(
fasta.templateInitializingFormalTypeMismatch
.withArguments(name, formalType, builder.field.type),
@ -4523,10 +4556,12 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
receiver = new SuperPropertyGetJudgment(name,
interfaceTarget: target, desugaredError: error)
..fileOffset = offset;
return new MethodInvocationJudgment(
MethodInvocation node = new MethodInvocationJudgment(
receiver, callName, forest.castArguments(arguments),
isImplicitCall: true, desugaredError: error)
..fileOffset = forest.readOffset(arguments);
delayedBoundsChecks.add(node);
return node;
}
if (isNullAware) {
@ -4545,12 +4580,14 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
desugaredError: error)
..fileOffset = offset;
} else {
return new MethodInvocationJudgment(
MethodInvocation node = new MethodInvocationJudgment(
receiver, name, forest.castArguments(arguments),
isImplicitCall: isImplicitCall,
interfaceTarget: interfaceTarget,
desugaredError: error)
..fileOffset = offset;
delayedBoundsChecks.add(node);
return node;
}
}

View file

@ -6,7 +6,7 @@
library fasta.kernel_api;
export 'package:kernel/type_algebra.dart'
show instantiateToBounds, Substitution;
show Substitution, instantiateToBounds, substitute;
export 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
@ -18,6 +18,8 @@ export 'package:kernel/transformations/flags.dart' show TransformerFlag;
export 'package:kernel/text/ast_to_text.dart' show NameSystem;
export 'package:kernel/type_environment.dart' show TypeEnvironment;
import 'package:kernel/text/ast_to_text.dart' show NameSystem, Printer;
import 'package:kernel/ast.dart' show Class, Member, Node;

View file

@ -9,6 +9,7 @@ library fasta.kernel_ast_api;
export 'package:kernel/ast.dart'
show
Arguments,
AsExpression,
AssertStatement,
AsyncMarker,
Block,
@ -33,6 +34,7 @@ export 'package:kernel/ast.dart'
InterfaceType,
InvalidExpression,
InvalidType,
IsExpression,
LabeledStatement,
Let,
Library,
@ -41,6 +43,7 @@ export 'package:kernel/ast.dart'
ListLiteral,
Location,
MapEntry,
MapLiteral,
Member,
MethodInvocation,
Name,
@ -61,11 +64,13 @@ export 'package:kernel/ast.dart'
SuperMethodInvocation,
SuperPropertySet,
SwitchCase,
ThisExpression,
Throw,
TreeNode,
TypeParameter,
TypeParameterType,
Typedef,
TypedefType,
VariableDeclaration,
VariableGet,
VariableSet,

View file

@ -20,6 +20,7 @@ import 'package:kernel/ast.dart'
Member,
Name,
Procedure,
RedirectingFactoryConstructor,
ReturnStatement,
VoidType,
MethodInvocation,
@ -62,6 +63,9 @@ import '../fasta_codes.dart'
templateImplementsSuperClass,
templateImplicitMixinOverrideContext,
templateInterfaceCheckContext,
templateIncorrectTypeArgument,
templateIncorrectTypeArgumentInSupertype,
templateIncorrectTypeArgumentInSupertypeInferred,
templateMissingImplementationCause,
templateMissingImplementationNotAbstract,
templateNamedMixinOverrideContext,
@ -160,6 +164,9 @@ abstract class KernelClassBuilder
for (int i = 0; i < result.length; ++i) {
result[i] = typeVariables[i].defaultType.build(library);
}
if (library is KernelLibraryBuilder) {
library.inferredTypes.addAll(result);
}
return result;
}
@ -269,6 +276,99 @@ abstract class KernelClassBuilder
}
}
void checkBoundsInSupertype(
Supertype supertype, TypeEnvironment typeEnvironment) {
KernelLibraryBuilder library = this.library;
List<Object> boundViolations = typeEnvironment.findBoundViolations(
new InterfaceType(supertype.classNode, supertype.typeArguments),
allowSuperBounded: false,
typedefInstantiations: library.typedefInstantiations);
if (boundViolations != null) {
for (int i = 0; i < boundViolations.length; i += 3) {
DartType argument = boundViolations[i];
TypeParameter variable = boundViolations[i + 1];
DartType enclosingType = boundViolations[i + 2];
Message message = library.inferredTypes.contains(argument)
? templateIncorrectTypeArgumentInSupertypeInferred.withArguments(
argument,
typeEnvironment.getGenericTypeName(enclosingType),
supertype.classNode.name,
name)
: templateIncorrectTypeArgumentInSupertype.withArguments(
argument,
typeEnvironment.getGenericTypeName(enclosingType),
supertype.classNode.name,
name);
library.reportBoundViolation(message, charOffset, variable);
}
}
}
void checkBoundsInOutline(TypeEnvironment typeEnvironment) {
KernelLibraryBuilder library = this.library;
// Check in bounds of own type variables.
for (TypeParameter parameter in cls.typeParameters) {
List<Object> violations = typeEnvironment.findBoundViolations(
parameter.bound,
allowSuperBounded: false,
typedefInstantiations: library.typedefInstantiations);
if (violations != null) {
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
if (library.inferredTypes.contains(argument)) {
// Inference in type expressions in the supertypes boils down to
// instantiate-to-bound which shouldn't produce anything that breaks
// the bounds after the non-simplicity checks are done. So, any
// violation here is the result of non-simple bounds, and the error
// is reported elsewhere.
continue;
}
library.reportBoundViolation(
templateIncorrectTypeArgument.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType)),
parameter.fileOffset,
variable);
}
}
}
// Check in supers.
if (cls.supertype != null) {
checkBoundsInSupertype(cls.supertype, typeEnvironment);
}
if (cls.mixedInType != null) {
checkBoundsInSupertype(cls.mixedInType, typeEnvironment);
}
if (cls.implementedTypes != null) {
for (Supertype supertype in cls.implementedTypes) {
checkBoundsInSupertype(supertype, typeEnvironment);
}
}
// Check in members.
for (Field field in cls.fields) {
library.checkBoundsInField(field, typeEnvironment);
}
for (Procedure procedure in cls.procedures) {
library.checkBoundsInFunctionNode(procedure.function, typeEnvironment);
}
for (Constructor constructor in cls.constructors) {
library.checkBoundsInFunctionNode(constructor.function, typeEnvironment);
}
for (RedirectingFactoryConstructor redirecting
in cls.redirectingFactoryConstructors) {
library.checkBoundsInFunctionNodeParts(
typeEnvironment, redirecting.fileOffset,
typeParameters: redirecting.typeParameters,
positionalParameters: redirecting.positionalParameters,
namedParameters: redirecting.namedParameters);
}
}
@override
int resolveConstructors(LibraryBuilder library) {
int count = super.resolveConstructors(library);

View file

@ -27,6 +27,7 @@ import 'kernel_builder.dart'
FunctionTypeAliasBuilder,
KernelFormalParameterBuilder,
KernelFunctionTypeBuilder,
KernelLibraryBuilder,
KernelTypeBuilder,
KernelTypeVariableBuilder,
LibraryBuilder,
@ -120,7 +121,11 @@ class KernelFunctionTypeAliasBuilder
for (int i = 0; i < target.typeParameters.length; i++) {
substitution[target.typeParameters[i]] = arguments[i];
}
return substitute(result, substitution);
result = substitute(result, substitution);
if (library is KernelLibraryBuilder) {
library.typedefInstantiations[result] = arguments;
}
return result;
}
List<DartType> buildTypeArguments(
@ -135,6 +140,9 @@ class KernelFunctionTypeAliasBuilder
for (int i = 0; i < result.length; ++i) {
result[i] = typeVariables[i].defaultType.build(library);
}
if (library is KernelLibraryBuilder) {
library.inferredTypes.addAll(result);
}
return result;
}

View file

@ -10,15 +10,22 @@ import 'package:kernel/ast.dart'
show
Arguments,
Class,
Constructor,
ConstructorInvocation,
DartType,
DynamicType,
Expression,
Field,
FunctionNode,
FunctionType,
InterfaceType,
Library,
LibraryDependency,
LibraryPart,
ListLiteral,
MapLiteral,
Member,
MethodInvocation,
Name,
Procedure,
ProcedureKind,
@ -26,11 +33,17 @@ import 'package:kernel/ast.dart'
StringLiteral,
TreeNode,
Typedef,
TypeParameter,
TypeParameterType,
VariableDeclaration,
VoidType;
import 'package:kernel/clone.dart' show CloneVisitor;
import 'package:kernel/type_algebra.dart' show substitute;
import 'package:kernel/type_environment.dart' show TypeEnvironment;
import '../../scanner/token.dart' show Token;
import '../export.dart' show Export;
@ -41,6 +54,7 @@ import '../fasta_codes.dart'
Message,
messageConflictsWithTypeVariableCause,
messageGenericFunctionTypeInBound,
messageIncorrectTypeArgumentVariable,
messageTypeVariableDuplicatedName,
messageTypeVariableSameNameAsEnclosing,
noLength,
@ -51,6 +65,9 @@ import '../fasta_codes.dart'
templateDuplicatedImportInType,
templateExportHidesExport,
templateImportHidesImport,
templateIncorrectTypeArgument,
templateIncorrectTypeArgumentInReturnType,
templateIncorrectTypeArgumentInferred,
templateLoadLibraryHidesMember,
templateLocalDefinitionHidesExport,
templateLocalDefinitionHidesImport,
@ -143,6 +160,17 @@ class KernelLibraryBuilder
// built.
final List<Procedure> forwardersOrigins = <Procedure>[];
// List of types inferred in the outline. Errors in these should be reported
// differently than for specified types.
// TODO(dmitryas): Find a way to mark inferred types.
final Set<DartType> inferredTypes = new Set<DartType>.identity();
// List of typedef instantiations built for this library. They are needed to
// perform type argument checks.
// TODO(dmitryas): Find a way to keep type arguments of typedefs around.
final Map<FunctionType, List<DartType>> typedefInstantiations =
new Map<FunctionType, List<DartType>>.identity();
/// Exports that can't be serialized.
///
/// The key is the name of the exported member.
@ -386,32 +414,20 @@ class KernelLibraryBuilder
}
}
/// The type variables used in [supertype] and the current mixin.
Map<String, TypeVariableBuilder> usedTypeVariables;
/// Helper function that updates [usedTypeVariables]. It needs to be
/// called twice per iteration: once on supertype and once on the current
/// mixin.
void computeUsedTypeVariables(KernelNamedTypeBuilder type) {
/// Helper function that returns `true` if a type variable with a name
/// from [typeVariableNames] is referenced in [type].
bool usesTypeVariables(KernelNamedTypeBuilder type) {
List<KernelTypeBuilder> typeArguments = type.arguments;
if (typeArguments != null && typeVariables != null) {
for (KernelTypeBuilder argument in typeArguments) {
if (typeVariableNames.contains(argument.name)) {
usedTypeVariables ??= <String, TypeVariableBuilder>{};
KernelTypeVariableBuilder freshTypeVariable =
(usedTypeVariables[argument.name] ??=
addTypeVariable(argument.name, null, charOffset));
// Notice that [argument] may have been created below as part of
// [applicationTypeArguments] and have to be rebound now
// (otherwise it would refer to a type variable in the subclass).
argument.bind(freshTypeVariable);
} else {
if (argument is KernelNamedTypeBuilder) {
computeUsedTypeVariables(argument);
}
return true;
} else if (argument is KernelNamedTypeBuilder) {
if (usesTypeVariables(argument)) return true;
}
}
}
return false;
}
/// Iterate over the mixins from left to right. At the end of each
@ -420,14 +436,14 @@ class KernelLibraryBuilder
for (int i = 0; i < type.mixins.length; i++) {
KernelTypeBuilder mixin = type.mixins[i];
isNamedMixinApplication = name != null && mixin == type.mixins.last;
usedTypeVariables = null;
bool isGeneric = false;
if (!isNamedMixinApplication) {
if (supertype is KernelNamedTypeBuilder) {
computeUsedTypeVariables(supertype);
isGeneric = isGeneric || usesTypeVariables(supertype);
}
if (mixin is KernelNamedTypeBuilder) {
runningName += "&${extractName(mixin.name)}";
computeUsedTypeVariables(mixin);
isGeneric = isGeneric || usesTypeVariables(mixin);
}
}
String fullname =
@ -441,20 +457,42 @@ class KernelLibraryBuilder
} else {
// Otherwise, we pass the fresh type variables to the mixin
// application in the same order as they're declared on the subclass.
if (usedTypeVariables != null) {
applicationTypeVariables = <TypeVariableBuilder>[];
if (isGeneric) {
this.beginNestedDeclaration("mixin application");
applicationTypeVariables =
copyTypeVariables(typeVariables, currentDeclaration);
List<TypeBuilder> newTypes = <TypeBuilder>[];
if (supertype is KernelNamedTypeBuilder &&
supertype.arguments != null) {
for (int i = 0; i < supertype.arguments.length; ++i) {
supertype.arguments[i] = supertype.arguments[i].clone(newTypes);
}
}
if (mixin is KernelNamedTypeBuilder && mixin.arguments != null) {
for (int i = 0; i < mixin.arguments.length; ++i) {
mixin.arguments[i] = mixin.arguments[i].clone(newTypes);
}
}
for (TypeBuilder newType in newTypes) {
currentDeclaration.addType(
new UnresolvedType<KernelTypeBuilder>(newType, -1, null));
}
DeclarationBuilder mixinDeclaration =
this.endNestedDeclaration("mixin application");
mixinDeclaration.resolveTypes(applicationTypeVariables, this);
applicationTypeArguments = <KernelTypeBuilder>[];
for (TypeVariableBuilder typeVariable in typeVariables) {
TypeVariableBuilder freshTypeVariable =
usedTypeVariables[typeVariable.name];
if (freshTypeVariable != null) {
applicationTypeVariables.add(freshTypeVariable);
applicationTypeArguments.add(
addNamedType(typeVariable.name, null, charOffset)..bind(
// This may be rebound in the next iteration when
// calling [computeUsedTypeVariables].
typeVariable));
}
applicationTypeArguments
.add(addNamedType(typeVariable.name, null, charOffset)..bind(
// The type variable types passed as arguments to the
// generic class representing the anonymous mixin
// application should refer back to the type variables of
// the class that extend the anonymous mixin application.
typeVariable));
}
}
}
@ -1316,6 +1354,407 @@ class KernelLibraryBuilder
(!member.isSetter && scope.local[name] == null));
addToExportScope(name, member);
}
void reportBoundViolation(
Message message, int fileOffset, TypeParameter violated) {
List<LocatedMessage> context;
if (violated.fileOffset != -1) {
// It looks like when parameters come from patch files, they don't
// have a reportable location.
context = <LocatedMessage>[
messageIncorrectTypeArgumentVariable.withLocation(
violated.location.file, violated.fileOffset, noLength)
];
}
addProblem(message, fileOffset, noLength, fileUri, context: context);
}
void checkBoundsInField(Field field, TypeEnvironment typeEnvironment) {
if (!loader.target.strongMode) return;
List<Object> boundViolations = typeEnvironment.findBoundViolations(
field.type,
allowSuperBounded: true,
typedefInstantiations: typedefInstantiations);
if (boundViolations != null) {
for (int i = 0; i < boundViolations.length; i += 3) {
DartType argument = boundViolations[i];
TypeParameter variable = boundViolations[i + 1];
DartType enclosingType = boundViolations[i + 2];
Message message = inferredTypes.contains(argument)
? templateIncorrectTypeArgumentInferred.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType))
: templateIncorrectTypeArgument.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType));
reportBoundViolation(message, field.fileOffset, variable);
}
}
}
void checkBoundsInFunctionNodeParts(
TypeEnvironment typeEnvironment, int fileOffset,
{List<TypeParameter> typeParameters,
List<VariableDeclaration> positionalParameters,
List<VariableDeclaration> namedParameters,
DartType returnType}) {
if (!loader.target.strongMode) return;
if (typeParameters != null) {
for (TypeParameter parameter in typeParameters) {
List<Object> violations = typeEnvironment.findBoundViolations(
parameter.bound,
allowSuperBounded: false,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
int offset = parameter.fileOffset;
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
Message message = inferredTypes.contains(argument)
? templateIncorrectTypeArgumentInferred.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType))
: templateIncorrectTypeArgument.withArguments(argument,
typeEnvironment.getGenericTypeName(enclosingType));
reportBoundViolation(message, offset, variable);
}
}
}
}
if (positionalParameters != null) {
for (VariableDeclaration formal in positionalParameters) {
List<Object> violations = typeEnvironment.findBoundViolations(
formal.type,
allowSuperBounded: true,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
int offset = formal.fileOffset;
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
Message message = inferredTypes.contains(argument)
? templateIncorrectTypeArgumentInferred.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType))
: templateIncorrectTypeArgument.withArguments(argument,
typeEnvironment.getGenericTypeName(enclosingType));
reportBoundViolation(message, offset, variable);
}
}
}
}
if (namedParameters != null) {
for (VariableDeclaration named in namedParameters) {
List<Object> violations = typeEnvironment.findBoundViolations(
named.type,
allowSuperBounded: true,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
int offset = named.fileOffset;
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
Message message = inferredTypes.contains(argument)
? templateIncorrectTypeArgumentInferred.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType))
: templateIncorrectTypeArgument.withArguments(argument,
typeEnvironment.getGenericTypeName(enclosingType));
reportBoundViolation(message, offset, variable);
}
}
}
}
if (returnType != null) {
List<Object> violations = typeEnvironment.findBoundViolations(returnType,
allowSuperBounded: true,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
int offset = fileOffset;
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
// We don't need to check if [argument] was inferred or specified
// here, because inference in return types boils down to instantiate-
// -to-bound, and it can't provide a type that violates the bound.
reportBoundViolation(
templateIncorrectTypeArgumentInReturnType.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType)),
offset,
variable);
}
}
}
}
void checkBoundsInFunctionNode(
FunctionNode function, TypeEnvironment typeEnvironment) {
if (!loader.target.strongMode) return;
checkBoundsInFunctionNodeParts(typeEnvironment, function.fileOffset,
typeParameters: function.typeParameters,
positionalParameters: function.positionalParameters,
namedParameters: function.namedParameters,
returnType: function.returnType);
}
void checkBoundsInListLiteral(
ListLiteral node, TypeEnvironment typeEnvironment,
{bool inferred = false}) {
if (!loader.target.strongMode) return;
checkBoundsInType(node.typeArgument, typeEnvironment, node.fileOffset,
inferred: inferred, allowSuperBounded: true);
}
void checkBoundsInMapLiteral(MapLiteral node, TypeEnvironment typeEnvironment,
{bool inferred = false}) {
if (!loader.target.strongMode) return;
checkBoundsInType(node.keyType, typeEnvironment, node.fileOffset,
inferred: inferred, allowSuperBounded: true);
checkBoundsInType(node.valueType, typeEnvironment, node.fileOffset,
inferred: inferred, allowSuperBounded: true);
}
void checkBoundsInType(
DartType type, TypeEnvironment typeEnvironment, int offset,
{bool inferred = false, bool allowSuperBounded = true}) {
if (!loader.target.strongMode) return;
List<Object> violations = typeEnvironment.findBoundViolations(type,
allowSuperBounded: allowSuperBounded,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
Message message = inferred
? templateIncorrectTypeArgumentInferred.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType))
: templateIncorrectTypeArgument.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType));
reportBoundViolation(message, offset, variable);
}
}
}
void checkBoundsInVariableDeclaration(
VariableDeclaration node, TypeEnvironment typeEnvironment,
{bool inferred = false}) {
if (!loader.target.strongMode) return;
if (node.type == null) return;
List<Object> violations = typeEnvironment.findBoundViolations(node.type,
allowSuperBounded: true, typedefInstantiations: typedefInstantiations);
if (violations != null) {
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
Message message = inferred
? templateIncorrectTypeArgumentInferred.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType))
: templateIncorrectTypeArgument.withArguments(
argument, typeEnvironment.getGenericTypeName(enclosingType));
reportBoundViolation(message, node.fileOffset, variable);
}
}
}
void checkBoundsInConstructorInvocation(
ConstructorInvocation node, TypeEnvironment typeEnvironment,
{bool inferred = false}) {
if (!loader.target.strongMode) return;
if (node.arguments.types.isEmpty) return;
Constructor constructor = node.target;
Class klass = constructor.enclosingClass;
DartType constructedType = new InterfaceType(klass, node.arguments.types);
List<Object> violations = typeEnvironment.findBoundViolations(
constructedType,
allowSuperBounded: false,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
String constructedTypeName = "${klass.name}::${constructor.name.name}";
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
String enclosingName = enclosingType == constructedType
? constructedTypeName
: typeEnvironment.getGenericTypeName(enclosingType);
Message message = inferred
? templateIncorrectTypeArgumentInferred.withArguments(
argument, enclosingName)
: templateIncorrectTypeArgument.withArguments(
argument, enclosingName);
reportBoundViolation(message, node.fileOffset, variable);
}
}
}
void checkBoundsInFactoryInvocation(
StaticInvocation node, TypeEnvironment typeEnvironment,
{bool inferred = false}) {
if (!loader.target.strongMode) return;
if (node.arguments.types.isEmpty) return;
Procedure factory = node.target;
assert(factory.isFactory);
Class klass = factory.enclosingClass;
DartType constructedType = new InterfaceType(klass, node.arguments.types);
List<Object> violations = typeEnvironment.findBoundViolations(
constructedType,
allowSuperBounded: false,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
String constructedTypeName = "${klass.name}::${factory.name.name}";
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
String enclosingName = enclosingType == constructedType
? constructedTypeName
: typeEnvironment.getGenericTypeName(enclosingType);
Message message = inferred
? templateIncorrectTypeArgumentInferred.withArguments(
argument, enclosingName)
: templateIncorrectTypeArgument.withArguments(
argument, enclosingName);
reportBoundViolation(message, node.fileOffset, variable);
}
}
}
void checkBoundsInStaticInvocation(
StaticInvocation node, TypeEnvironment typeEnvironment,
{bool inferred = false}) {
if (!loader.target.strongMode) return;
if (node.arguments.types.isEmpty) return;
Class klass = node.target.enclosingClass;
List<TypeParameter> parameters = node.target.function.typeParameters;
List<DartType> arguments = node.arguments.types;
// The following error is to be reported elsewhere.
if (parameters.length != arguments.length) return;
List<Object> violations = typeEnvironment.findBoundViolationsElementwise(
parameters, arguments,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
String targetName;
if (klass == null) {
targetName = "${node.target.name.name}";
} else {
targetName = "${klass.name}::${node.target.name.name}";
}
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
String enclosingName = enclosingType == null
? targetName
: typeEnvironment.getGenericTypeName(enclosingType);
Message message = inferred
? templateIncorrectTypeArgumentInferred.withArguments(
argument, enclosingName)
: templateIncorrectTypeArgument.withArguments(
argument, enclosingName);
reportBoundViolation(message, node.fileOffset, variable);
}
}
}
void checkBoundsInMethodInvocation(
MethodInvocation node, Class thisClass, TypeEnvironment typeEnvironment,
{bool inferred = false}) {
if (!loader.target.strongMode) return;
if (node.arguments.types.isEmpty) return;
DartType savedThisType = typeEnvironment.thisType;
if (thisClass != null) {
typeEnvironment.thisType = new InterfaceType(
thisClass,
thisClass.typeParameters
.map((p) => new TypeParameterType(p))
.toList());
}
DartType receiverType;
try {
receiverType = node.receiver.getStaticType(typeEnvironment);
} finally {
typeEnvironment.thisType = savedThisType;
}
Class klass;
List<DartType> klassArguments;
if (receiverType is InterfaceType) {
klass = receiverType.classNode;
klassArguments = receiverType.typeArguments;
} else {
return;
}
Map<TypeParameter, DartType> substitutionMap = <TypeParameter, DartType>{};
for (int i = 0; i < klassArguments.length; ++i) {
substitutionMap[klass.typeParameters[i]] = klassArguments[i];
}
// TODO(dmitryas): Find a better way than relying on [interfaceTarget].
Member method =
typeEnvironment.hierarchy.getDispatchTarget(klass, node.name) ??
node.interfaceTarget;
if (method == null || method is! Procedure) {
return;
}
List<TypeParameter> methodParameters = method.function.typeParameters;
// The error is to be reported elsewhere.
if (methodParameters.length != node.arguments.types.length) return;
List<TypeParameter> instantiatedMethodParameters =
new List<TypeParameter>.filled(methodParameters.length, null);
for (int i = 0; i < instantiatedMethodParameters.length; ++i) {
instantiatedMethodParameters[i] =
new TypeParameter(methodParameters[i].name);
substitutionMap[methodParameters[i]] =
new TypeParameterType(instantiatedMethodParameters[i]);
}
for (int i = 0; i < instantiatedMethodParameters.length; ++i) {
instantiatedMethodParameters[i].bound =
substitute(methodParameters[i].bound, substitutionMap);
}
List<Object> violations = typeEnvironment.findBoundViolationsElementwise(
instantiatedMethodParameters, node.arguments.types,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
String targetName = "${klass.name}";
if (klassArguments.length > 0) {
targetName += "<${klassArguments[0]}";
for (int i = 1; i < klassArguments.length; ++i) {
targetName += ", ${klassArguments[i]}";
}
targetName += ">";
}
targetName += "::${node.name.name}";
for (int i = 0; i < violations.length; i += 3) {
DartType argument = violations[i];
TypeParameter variable = violations[i + 1];
DartType enclosingType = violations[i + 2];
String enclosingName = enclosingType == null
? targetName
: typeEnvironment.getGenericTypeName(enclosingType);
Message message = inferred
? templateIncorrectTypeArgumentInferred.withArguments(
argument, enclosingName)
: templateIncorrectTypeArgument.withArguments(
argument, enclosingName);
reportBoundViolation(message, node.fileOffset, variable);
}
}
}
void checkBoundsInOutline(TypeEnvironment typeEnvironment) {
if (!loader.target.strongMode) return;
forEach((String name, Declaration declaration) {
if (declaration is KernelFieldBuilder) {
checkBoundsInField(declaration.target, typeEnvironment);
} else if (declaration is KernelProcedureBuilder) {
checkBoundsInFunctionNode(declaration.target.function, typeEnvironment);
} else if (declaration is KernelClassBuilder) {
declaration.checkBoundsInOutline(typeEnvironment);
}
});
typedefInstantiations.clear();
inferredTypes.clear();
}
}
Uri computeLibraryUri(Declaration declaration) {

View file

@ -41,13 +41,14 @@ import '../fasta_codes.dart'
messageVoidExpression,
noLength,
templateCantInferTypeDueToCircularity,
templateCantUseSuperBoundedTypeForInstanceCreation,
templateForInLoopElementTypeNotAssignable,
templateForInLoopTypeNotIterable,
templateIntegerLiteralIsOutOfRange,
templateSwitchExpressionNotAssignable,
templateWebLiteralCannotBeRepresentedExactly;
import '../kernel/kernel_library_builder.dart' show KernelLibraryBuilder;
import '../problems.dart' show unhandled, unsupported;
import '../source/source_class_builder.dart' show SourceClassBuilder;
@ -716,6 +717,8 @@ class ConstructorInvocationJudgment extends ConstructorInvocation
}
inferrer.engine.beingInferred.remove(target);
}
bool hasExplicitTypeArguments =
getExplicitTypeArguments(argumentJudgments) != null;
var inferenceResult = inferrer.inferInvocation(
typeContext,
fileOffset,
@ -725,14 +728,11 @@ class ConstructorInvocationJudgment extends ConstructorInvocation
isConst: isConst);
var inferredType = inferenceResult.type;
this.inferredType = inferredType;
if (inferrer.strongMode &&
!inferrer.isTopLevel &&
inferrer.typeSchemaEnvironment.isSuperBounded(inferredType)) {
inferrer.helper.addProblem(
templateCantUseSuperBoundedTypeForInstanceCreation
.withArguments(inferredType),
fileOffset,
noLength);
SourceLibraryBuilder inferrerLibrary = inferrer.library;
if (!hasExplicitTypeArguments && inferrerLibrary is KernelLibraryBuilder) {
inferrerLibrary.checkBoundsInConstructorInvocation(
this, inferrer.typeSchemaEnvironment,
inferred: true);
}
return null;
}
@ -854,6 +854,7 @@ class FactoryConstructorInvocationJudgment extends StaticInvocation
@override
Expression infer(ShadowTypeInferrer inferrer, DartType typeContext) {
bool hadExplicitTypeArguments = getExplicitTypeArguments(arguments) != null;
var inferenceResult = inferrer.inferInvocation(
typeContext,
fileOffset,
@ -862,6 +863,12 @@ class FactoryConstructorInvocationJudgment extends StaticInvocation
argumentJudgments,
isConst: isConst);
inferredType = inferenceResult.type;
SourceLibraryBuilder inferrerLibrary = inferrer.library;
if (!hadExplicitTypeArguments && inferrerLibrary is KernelLibraryBuilder) {
inferrerLibrary.checkBoundsInFactoryInvocation(
this, inferrer.typeSchemaEnvironment,
inferred: true);
}
return null;
}
}
@ -1653,6 +1660,13 @@ class ListLiteralJudgment extends ListLiteral implements ExpressionJudgment {
}
}
inferredType = new InterfaceType(listClass, [inferredTypeArgument]);
SourceLibraryBuilder inferrerLibrary = inferrer.library;
if (_declaredTypeArgument == null &&
inferrerLibrary is KernelLibraryBuilder) {
inferrerLibrary.checkBoundsInListLiteral(
this, inferrer.typeSchemaEnvironment,
inferred: true);
}
return null;
}
}
@ -1806,6 +1820,14 @@ class MapLiteralJudgment extends MapLiteral implements ExpressionJudgment {
}
inferredType =
new InterfaceType(mapClass, [inferredKeyType, inferredValueType]);
SourceLibraryBuilder inferrerLibrary = inferrer.library;
// Either both [_declaredKeyType] and [_declaredValueType] are omitted or
// none of them, so we may just check one.
if (_declaredKeyType == null && inferrerLibrary is KernelLibraryBuilder) {
inferrerLibrary.checkBoundsInMapLiteral(
this, inferrer.typeSchemaEnvironment,
inferred: true);
}
return null;
}
}
@ -1920,6 +1942,7 @@ class MethodInvocationJudgment extends MethodInvocation
}
}
}
bool hadExplicitTypeArguments = getExplicitTypeArguments(arguments) != null;
var inferenceResult = inferrer.inferMethodInvocation(
this, receiver, fileOffset, _isImplicitCall, typeContext,
desugaredInvocation: this);
@ -1928,6 +1951,12 @@ class MethodInvocationJudgment extends MethodInvocation
parent.replaceChild(this, desugaredError);
parent = null;
}
SourceLibraryBuilder inferrerLibrary = inferrer.library;
if (!hadExplicitTypeArguments && inferrerLibrary is KernelLibraryBuilder) {
inferrerLibrary.checkBoundsInMethodInvocation(
this, inferrer.thisType?.classNode, inferrer.typeSchemaEnvironment,
inferred: true);
}
return null;
}
}
@ -2336,6 +2365,8 @@ class StaticInvocationJudgment extends StaticInvocation
FunctionType calleeType = target != null
? target.function.functionType
: new FunctionType([], const DynamicType());
bool hadExplicitTypeArguments =
getExplicitTypeArguments(argumentJudgments) != null;
var inferenceResult = inferrer.inferInvocation(typeContext, fileOffset,
calleeType, calleeType.returnType, argumentJudgments);
inferredType = inferenceResult.type;
@ -2343,6 +2374,14 @@ class StaticInvocationJudgment extends StaticInvocation
parent.replaceChild(this, desugaredError);
parent = null;
}
SourceLibraryBuilder inferrerLibrary = inferrer.library;
if (!hadExplicitTypeArguments &&
target != null &&
inferrerLibrary is KernelLibraryBuilder) {
inferrerLibrary.checkBoundsInStaticInvocation(
this, inferrer.typeSchemaEnvironment,
inferred: true);
}
return null;
}
}
@ -3133,6 +3172,12 @@ class VariableDeclarationJudgment extends VariableDeclaration
initializer = replacedInitializer;
}
}
SourceLibraryBuilder inferrerLibrary = inferrer.library;
if (_implicitlyTyped && inferrerLibrary is KernelLibraryBuilder) {
inferrerLibrary.checkBoundsInVariableDeclaration(
this, inferrer.typeSchemaEnvironment,
inferred: true);
}
}
/// Determine whether the given [VariableDeclarationJudgment] had an implicit

View file

@ -262,6 +262,7 @@ class KernelTarget extends TargetImplementation {
loader.computeHierarchy();
loader.performTopLevelInference(myClasses);
loader.checkSupertypes(myClasses);
loader.checkBounds();
loader.checkOverrides(myClasses);
loader.checkAbstractMembers(myClasses);
loader.checkRedirectingFactories(myClasses);

View file

@ -842,6 +842,8 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
accessProblem = message;
}
}
void checkBoundsInOutline(covariant typeEnvironment);
}
/// Unlike [Scope], this scope is used during construction of builders to

View file

@ -831,6 +831,17 @@ class SourceLoader<L> extends Loader<L> {
ticker.logMs("Checked overrides");
}
void checkBounds() {
if (!target.strongMode) return;
builders.forEach((Uri uri, LibraryBuilder library) {
if (library is SourceLibraryBuilder) {
library.checkBoundsInOutline(typeInferenceEngine.typeSchemaEnvironment);
}
});
ticker.logMs("Checked type arguments of supers against the bounds");
}
void checkOverrides(List<SourceClassBuilder> sourceClasses) {
assert(hierarchy != null);
for (SourceClassBuilder builder in sourceClasses) {

View file

@ -1177,7 +1177,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
bool isConst: false}) {
lastInferredSubstitution = null;
lastCalleeType = null;
var calleeTypeParameters = calleeType.typeParameters;
List<TypeParameter> calleeTypeParameters = calleeType.typeParameters;
if (calleeTypeParameters.isNotEmpty) {
// It's possible that one of the callee type parameters might match a type
// that already exists as part of inference (e.g. the type of an

View file

@ -2840,10 +2840,6 @@ AmbiguousSupertypes:
template: "'#name' can't implement both '#type' and '#type2'"
analyzerCode: AMBIGUOUS_SUPERTYPES
CantUseSuperBoundedTypeForInstanceCreation:
template: "Can't use a super-bounded type for instance creation. Got '#type'."
tip: "Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference."
MixinInferenceNoMatchingClass:
template: "Type parameters could not be inferred for the mixin '#name' because '#name2' does not implement the mixin's supertype constraint '#type'."
analyzerCode: MIXIN_INFERENCE_NO_POSSIBLE_SUBSTITUTION
@ -3173,3 +3169,47 @@ RedirectingFactoryIncompatibleTypeArgument:
SyntheticToken:
template: "This couldn't be parsed."
frontendInternal: true
IncorrectTypeArgument:
template: "Type argument '#type' violates the corresponding type variable bound of '#name'."
tip: "Try changing type arguments so that they conform to the bounds."
analyzerCode: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
script: >
class C<T extends num> {}
main() { new C<String>(); }
IncorrectTypeArgumentInSupertype:
template: "Type argument '#type' violates the corresponding type variable bound of '#name' in the supertype '#name2' of class '#name3'."
tip: "Try changing type arguments so that they conform to the bounds."
analyzerCode: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
script: >
class A<T extends num> {}
class B extends A<String> {}
IncorrectTypeArgumentInReturnType:
template: "Type argument '#type' violates the corresponding type variable bound of '#name' in the return type."
tip: "Try changing type arguments so that they conform to the bounds."
analyzerCode: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
script: >
class A<T extends num> {}
A<String> foo() => null;
IncorrectTypeArgumentInferred:
template: "Inferred type argument '#type' violates the corresponding type variable bound of '#name'."
tip: "Try specifying type arguments explicitly so that they conform to the bounds."
analyzerCode: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
script: >
void foo<T extends num>(T t) {}
main() { foo("bar"); }
IncorrectTypeArgumentInSupertypeInferred:
template: "Inferred type argument '#type' violates the corresponding type variable bound of '#name' in the supertype '#name2' of class '#name3'."
tip: "Try specifying type arguments explicitly so that they conform to the bounds."
analyzerCode: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
script: >
class A<T extends A<T>> {}
class B extends A {}
IncorrectTypeArgumentVariable:
template: "Bound of this variable is violated."
severity: CONTEXT

View file

@ -0,0 +1,21 @@
// Copyright (c) 2018, 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.
// This testcase checks an implementation detail in the bounds checking
// mechanism. Here String passed into bar should be checked against the bound
// that depends on the result of type inference for expression `B.foo()`.
class A<X> {
bar<Y extends X>() => null;
}
class B {
static A<Y> foo<Y extends Object>() => null;
}
baz() {
B.foo().bar<String>();
}
main() {}

View file

@ -0,0 +1,22 @@
library;
import self as self;
import "dart:core" as core;
class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → self::A<self::A::X>
: super core::Object::•()
;
method bar<Y extends self::A::X = dynamic>() → dynamic
return null;
}
class B extends core::Object {
synthetic constructor •() → self::B
: super core::Object::•()
;
static method foo<Y extends core::Object = dynamic>() → self::A<self::B::foo::Y>
return null;
}
static method baz() → dynamic {
self::B::foo<dynamic>().bar<core::String>();
}
static method main() → dynamic {}

View file

@ -0,0 +1,22 @@
library;
import self as self;
import "dart:core" as core;
class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → self::A<self::A::X>
: super core::Object::•()
;
method bar<Y extends self::A::X = dynamic>() → dynamic
return null;
}
class B extends core::Object {
synthetic constructor •() → self::B
: super core::Object::•()
;
static method foo<Y extends core::Object = dynamic>() → self::A<self::B::foo::Y>
return null;
}
static method baz() → dynamic {
self::B::foo<dynamic>().bar<core::String>();
}
static method main() → dynamic {}

View file

@ -0,0 +1,20 @@
library;
import self as self;
import "dart:core" as core;
class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → self::A<self::A::X>
;
method bar<Y extends self::A::X = dynamic>() → dynamic
;
}
class B extends core::Object {
synthetic constructor •() → self::B
;
static method foo<Y extends core::Object = dynamic>() → self::A<self::B::foo::Y>
;
}
static method baz() → dynamic
;
static method main() → dynamic
;

View file

@ -0,0 +1,22 @@
library;
import self as self;
import "dart:core" as core;
class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → self::A<self::A::X>
: super core::Object::•()
;
method bar<generic-covariant-impl Y extends self::A::X = self::A::X>() → dynamic
return null;
}
class B extends core::Object {
synthetic constructor •() → self::B
: super core::Object::•()
;
static method foo<Y extends core::Object = core::Object>() → self::A<self::B::foo::Y>
return null;
}
static method baz() → dynamic {
self::B::foo<core::Object>().{self::A::bar}<core::String>();
}
static method main() → dynamic {}

View file

@ -0,0 +1,22 @@
library;
import self as self;
import "dart:core" as core;
class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → self::A<self::A::X>
: super core::Object::•()
;
method bar<generic-covariant-impl Y extends self::A::X = self::A::X>() → dynamic
return null;
}
class B extends core::Object {
synthetic constructor •() → self::B
: super core::Object::•()
;
static method foo<Y extends core::Object = core::Object>() → self::A<self::B::foo::Y>
return null;
}
static method baz() → dynamic {
self::B::foo<core::Object>().{self::A::bar}<core::String>();
}
static method main() → dynamic {}

View file

@ -1,4 +1,6 @@
Errors: {
Type argument 'main::A::T' violates the corresponding type variable bound of 'hasBound'. (@0)
Bound of this variable is violated. (@637)
}
method /* from org-dartlang-debug:synthetic_debug_expression */ debugExpr(dynamic x) → dynamic
return main::hasBound<main::A::T>();

View file

@ -1,4 +1,6 @@
Errors: {
Type argument 'T' violates the corresponding type variable bound of 'hasBound'. (@0)
Bound of this variable is violated. (@637)
}
method /* from org-dartlang-debug:synthetic_debug_expression */ debugExpr<T extends dynamic>() → dynamic
return main::hasBound<#lib1::debugExpr::T>();

View file

@ -0,0 +1,21 @@
library test;
import self as self;
import "dart:core" as core;
typedef F<T extends core::Object = dynamic> = () → T;
class A extends core::Object {
synthetic constructor •() → self::A
;
}
class C<T extends self::A = dynamic> extends core::Object {
constructor •(() → self::C::T f) → self::C<self::C::T>
;
}
class NotA extends core::Object {
synthetic constructor •() → self::NotA
;
}
static method myF() → self::NotA
;
static method main() → dynamic
;

View file

@ -1,3 +1,33 @@
// Formatted problems:
//
// pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart:22:56: Error: Inferred type argument 'test::NotA' violates the corresponding type variable bound of 'C::'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER*/ /*@typeArgs=NotA*/ C(myF);
// ^
// pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart:12:9: Context: Bound of this variable is violated.
// class C<T extends A> {
// ^
//
// pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart:21:25: Error: Inferred type argument 'test::NotA' violates the corresponding type variable bound of 'C'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var /*@type=C<NotA>*/ x =
// ^
// pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart:12:9: Context: Bound of this variable is violated.
// class C<T extends A> {
// ^
// Unhandled errors:
//
// pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart:22:56: Error: Inferred type argument 'test::NotA' violates the corresponding type variable bound of 'C::'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER*/ /*@typeArgs=NotA*/ C(myF);
// ^
//
// pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart:21:25: Error: Inferred type argument 'test::NotA' violates the corresponding type variable bound of 'C'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var /*@type=C<NotA>*/ x =
// ^
library test;
import self as self;
import "dart:core" as core;

View file

@ -0,0 +1,20 @@
library test;
import self as self;
import "dart:core" as core;
class Clonable<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → self::Clonable<self::Clonable::T>
;
}
class Pair<T extends self::Clonable<self::Pair::T> = dynamic, U extends self::Clonable<self::Pair::U> = dynamic> extends core::Object {
field self::Pair::T t;
field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → self::Pair<self::Pair::T, self::Pair::U>
;
constructor _() → self::Pair<self::Pair::T, self::Pair::U>
;
get reversed() → self::Pair<self::Pair::U, self::Pair::T>
;
}
static method main() → dynamic
;

View file

@ -1,14 +1,30 @@
// Formatted problems:
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Can't use a super-bounded type for instance creation. Got 'test::Pair<test::Clonable<dynamic>, test::Clonable<dynamic>>'.
// Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Inferred type argument 'test::Clonable<dynamic>' violates the corresponding type variable bound of 'Pair::_'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Clonable<dynamic>, Clonable<dynamic>*/ Pair
// ^
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:10:12: Context: Bound of this variable is violated.
// class Pair<T extends Clonable<T>, U extends Clonable<U>> {
// ^
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Inferred type argument 'test::Clonable<dynamic>' violates the corresponding type variable bound of 'Pair::_'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Clonable<dynamic>, Clonable<dynamic>*/ Pair
// ^
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:10:35: Context: Bound of this variable is violated.
// class Pair<T extends Clonable<T>, U extends Clonable<U>> {
// ^
// Unhandled errors:
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Can't use a super-bounded type for instance creation. Got 'test::Pair<test::Clonable<dynamic>, test::Clonable<dynamic>>'.
// Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Inferred type argument 'test::Clonable<dynamic>' violates the corresponding type variable bound of 'Pair::_'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Clonable<dynamic>, Clonable<dynamic>*/ Pair
// ^
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Inferred type argument 'test::Clonable<dynamic>' violates the corresponding type variable bound of 'Pair::_'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Clonable<dynamic>, Clonable<dynamic>*/ Pair
// ^

View file

@ -1,7 +1,12 @@
// Unhandled errors:
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Can't use a super-bounded type for instance creation. Got 'test::Pair<test::Clonable<dynamic>, test::Clonable<dynamic>>'.
// Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Inferred type argument 'test::Clonable<dynamic>' violates the corresponding type variable bound of 'Pair::_'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Clonable<dynamic>, Clonable<dynamic>*/ Pair
// ^
//
// pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart:22:110: Error: Inferred type argument 'test::Clonable<dynamic>' violates the corresponding type variable bound of 'Pair::_'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// new /*error:COULD_NOT_INFER,error:COULD_NOT_INFER*/ /*@typeArgs=Clonable<dynamic>, Clonable<dynamic>*/ Pair
// ^

View file

@ -0,0 +1,7 @@
library test;
import self as self;
static method f() → dynamic
;
static method main() → dynamic
;

View file

@ -1,3 +1,27 @@
// Formatted problems:
//
// pkg/front_end/testcases/inference/downward_inference_fixes_no_upwards_errors.dart:21:63: Error: Inferred type argument 'dynamic' violates the corresponding type variable bound of 'max'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// dynamic c = /*error:COULD_NOT_INFER*/ /*@typeArgs=dynamic*/ max(x, y);
// ^
//
// pkg/front_end/testcases/inference/downward_inference_fixes_no_upwards_errors.dart:22:77: Error: Inferred type argument 'dynamic' violates the corresponding type variable bound of 'max'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var /*@type=dynamic*/ d = /*error:COULD_NOT_INFER*/ /*@typeArgs=dynamic*/ max(
// ^
// Unhandled errors:
//
// pkg/front_end/testcases/inference/downward_inference_fixes_no_upwards_errors.dart:21:63: Error: Inferred type argument 'dynamic' violates the corresponding type variable bound of 'max'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// dynamic c = /*error:COULD_NOT_INFER*/ /*@typeArgs=dynamic*/ max(x, y);
// ^
//
// pkg/front_end/testcases/inference/downward_inference_fixes_no_upwards_errors.dart:22:77: Error: Inferred type argument 'dynamic' violates the corresponding type variable bound of 'max'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var /*@type=dynamic*/ d = /*error:COULD_NOT_INFER*/ /*@typeArgs=dynamic*/ max(
// ^
library test;
import self as self;
import "dart:core" as core;

View file

@ -1,3 +1,15 @@
// Unhandled errors:
//
// pkg/front_end/testcases/inference/downward_inference_fixes_no_upwards_errors.dart:21:63: Error: Inferred type argument 'dynamic' violates the corresponding type variable bound of 'max'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// dynamic c = /*error:COULD_NOT_INFER*/ /*@typeArgs=dynamic*/ max(x, y);
// ^
//
// pkg/front_end/testcases/inference/downward_inference_fixes_no_upwards_errors.dart:22:77: Error: Inferred type argument 'dynamic' violates the corresponding type variable bound of 'max'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var /*@type=dynamic*/ d = /*error:COULD_NOT_INFER*/ /*@typeArgs=dynamic*/ max(
// ^
library test;
import self as self;
import "dart:core" as core;

View file

@ -0,0 +1,12 @@
library test;
import self as self;
import "dart:core" as core;
class Foo<T extends core::Pattern = dynamic> extends core::Object {
synthetic constructor •() → self::Foo<self::Foo::T>
;
method method<U extends self::Foo::T = dynamic>(self::Foo::method::U u) → self::Foo::method::U
;
}
static method main() → dynamic
;

View file

@ -1,3 +1,27 @@
// Formatted problems:
//
// pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Inferred type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method(
// ^
//
// pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'.
// Try changing type arguments so that they conform to the bounds.
// . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method(
// ^
// Unhandled errors:
//
// pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Inferred type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method(
// ^
//
// pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart:26:77: Error: Type argument 'dart.core::int' violates the corresponding type variable bound of 'Foo<dart.core::String>::method'.
// Try changing type arguments so that they conform to the bounds.
// . /*error:COULD_NOT_INFER*/ /*@typeArgs=int*/ /*@target=Foo::method*/ method(
// ^
library test;
import self as self;
import "dart:core" as core;

View file

@ -1,3 +1,20 @@
// Formatted problems:
//
// pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart:13:7: Error: Type argument 'dart.core::Comparable<dynamic>' violates the corresponding type variable bound of 'M0' in the supertype 'M0' of class 'M1 with M0'.
// Try changing type arguments so that they conform to the bounds.
// class A extends M1 with M0 {}
// ^
// pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart:7:13: Context: Bound of this variable is violated.
// class M0<X, Y extends Comparable<Y>> extends I<X> {}
// ^
// Unhandled errors:
//
// pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart:13:7: Error: Type argument 'dart.core::Comparable<dynamic>' violates the corresponding type variable bound of 'M0' in the supertype 'M0' of class 'M1 with M0'.
// Try changing type arguments so that they conform to the bounds.
// class A extends M1 with M0 {}
// ^
library;
import self as self;
import "dart:core" as core;

View file

@ -1,3 +1,10 @@
// Unhandled errors:
//
// pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart:13:7: Error: Type argument 'dart.core::Comparable<dynamic>' violates the corresponding type variable bound of 'M0' in the supertype 'M0' of class 'M1 with M0'.
// Try changing type arguments so that they conform to the bounds.
// class A extends M1 with M0 {}
// ^
library;
import self as self;
import "dart:core" as core;

View file

@ -1,14 +1,17 @@
// Formatted problems:
//
// pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart:11:13: Error: Can't use a super-bounded type for instance creation. Got '#lib1::B<dart.core::Comparable<dynamic>>'.
// Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.
// pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart:11:13: Error: Inferred type argument 'dart.core::Comparable<dynamic>' violates the corresponding type variable bound of 'B::'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var y = new B();
// ^
// pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart:9:9: Context: Bound of this variable is violated.
// class B<T extends Comparable<T>> {}
// ^
// Unhandled errors:
//
// pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart:11:13: Error: Can't use a super-bounded type for instance creation. Got '#lib1::B<dart.core::Comparable<dynamic>>'.
// Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.
// pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart:11:13: Error: Inferred type argument 'dart.core::Comparable<dynamic>' violates the corresponding type variable bound of 'B::'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var y = new B();
// ^

View file

@ -1,7 +1,7 @@
// Unhandled errors:
//
// pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart:11:13: Error: Can't use a super-bounded type for instance creation. Got '#lib1::B<dart.core::Comparable<dynamic>>'.
// Specify a regular-bounded type instead of the super-bounded type. Note that the latter may be due to type inference.
// pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart:11:13: Error: Inferred type argument 'dart.core::Comparable<dynamic>' violates the corresponding type variable bound of 'B::'.
// Try specifying type arguments explicitly so that they conform to the bounds.
// var y = new B();
// ^

View file

@ -4,6 +4,11 @@
// Try providing type arguments to 'LinkedListEntry' here.
// class Hest<X extends LinkedListEntry> {}
// ^
//
// pkg/front_end/testcases/instantiate_to_bound/non_simple_from_compiled.dart:15:12: Error: Type argument 'dart.collection::LinkedListEntry<dynamic>' violates the corresponding type variable bound of 'LinkedListEntry'.
// Try changing type arguments so that they conform to the bounds.
// class Hest<X extends LinkedListEntry> {}
// ^
// Unhandled errors:
//
@ -11,6 +16,11 @@
// Try providing type arguments to 'LinkedListEntry' here.
// class Hest<X extends LinkedListEntry> {}
// ^
//
// pkg/front_end/testcases/instantiate_to_bound/non_simple_from_compiled.dart:15:12: Error: Type argument 'dart.collection::LinkedListEntry<dynamic>' violates the corresponding type variable bound of 'LinkedListEntry'.
// Try changing type arguments so that they conform to the bounds.
// class Hest<X extends LinkedListEntry> {}
// ^
library;
import self as self;

View file

@ -4,6 +4,11 @@
// Try providing type arguments to 'LinkedListEntry' here.
// class Hest<X extends LinkedListEntry> {}
// ^
//
// pkg/front_end/testcases/instantiate_to_bound/non_simple_from_compiled.dart:15:12: Error: Type argument 'dart.collection::LinkedListEntry<dynamic>' violates the corresponding type variable bound of 'LinkedListEntry'.
// Try changing type arguments so that they conform to the bounds.
// class Hest<X extends LinkedListEntry> {}
// ^
library;
import self as self;

View file

@ -35,7 +35,6 @@ inference/conflicts_can_happen: Fail
inference/conflicts_can_happen2: Fail
inference/constructors_downwards_with_constraint: Fail
inference/constructors_infer_from_arguments: Fail
inference/constructors_infer_from_arguments_argument_not_assignable: Fail
inference/constructors_infer_from_arguments_const: Fail
inference/constructors_infer_from_arguments_const_with_upper_bound: Fail
inference/constructors_infer_from_arguments_downwards_from_constructor: Fail
@ -45,14 +44,12 @@ inference/constructors_infer_from_arguments_named: Fail
inference/constructors_infer_from_arguments_named_factory: Fail
inference/constructors_infer_from_arguments_redirecting: Fail
inference/constructors_infer_from_arguments_redirecting_factory: Fail
inference/constructors_inference_f_bounded: Fail
inference/constructors_reverse_type_parameters: Fail
inference/constructors_too_many_positional_arguments: Fail
inference/do_not_infer_overridden_fields_that_explicitly_say_dynamic_infer: Fail
inference/dont_infer_field_type_when_initializer_is_null: Fail
inference/dont_infer_type_on_dynamic: Fail
inference/dont_infer_type_when_initializer_is_null: Fail
inference/downward_inference_fixes_no_upwards_errors: Fail
inference/downward_inference_miscellaneous: Fail
inference/downwards_inference_assignment_statements: Fail
inference/downwards_inference_async_await: Fail
@ -76,7 +73,6 @@ inference/field_refers_to_top_level_getter: Fail
inference/future_or_subtyping: Fail
inference/generic_functions_return_typedef: Fail
inference/generic_methods_basic_downward_inference: Fail
inference/generic_methods_correctly_recognize_generic_upper_bound: Fail
inference/generic_methods_dart_math_min_max: Fail
inference/generic_methods_do_not_infer_invalid_override_of_generic_method: Fail
inference/generic_methods_downwards_inference_affects_arguments: Fail

View file

@ -4,6 +4,18 @@
// Try changing the type of the parameter, or casting the argument to 'test::C::g1::U'.
// this.f<U>(1.5);
// ^
//
// pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:20:16: Error: Type argument 'dart.core::num' violates the corresponding type variable bound of 'C<dart.core::int>::g1'.
// Try changing type arguments so that they conform to the bounds.
// new C<int>().g1<num>();
// ^
// Unhandled errors:
//
// pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:20:16: Error: Type argument 'dart.core::num' violates the corresponding type variable bound of 'C<dart.core::int>::g1'.
// Try changing type arguments so that they conform to the bounds.
// new C<int>().g1<num>();
// ^
library test;
import self as self;

View file

@ -1,3 +1,10 @@
// Unhandled errors:
//
// pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:20:16: Error: Type argument 'dart.core::num' violates the corresponding type variable bound of 'C<dart.core::int>::g1'.
// Try changing type arguments so that they conform to the bounds.
// new C<int>().g1<num>();
// ^
library test;
import self as self;
import "dart:core" as core;

View file

@ -152,53 +152,60 @@ class TypeEnvironment extends SubtypeTester {
return !hierarchy.hasProperSubtypes(class_);
}
bool isObject(DartType type) {
return type is InterfaceType && type.classNode == objectType.classNode;
}
bool isNull(DartType type) {
return type is InterfaceType && type.classNode == nullType.classNode;
}
/// Replaces all covariant occurrences of `dynamic`, `Object`, and `void` with
/// `Null` and all contravariant occurrences of `Null` with `Object`.
DartType replaceTopAndBottom(DartType type, {bool isCovariant = true}) {
if (type is DynamicType && isCovariant) {
return const BottomType();
} else if (type is InterfaceType &&
type.classNode == objectType.classNode &&
/// [BottomType] and all contravariant occurrences of `Null` and [BottomType]
/// with `Object`.
DartType convertSuperBoundedToRegularBounded(DartType type,
{bool isCovariant = true}) {
if ((type is DynamicType || type is VoidType || isObject(type)) &&
isCovariant) {
return const BottomType();
} else if ((type is BottomType || isNull(type)) && !isCovariant) {
return objectType;
} else if (type is InterfaceType && type.classNode.typeParameters != null) {
List<DartType> typeArguments = type.typeArguments ??
calculateBounds(type.classNode.typeParameters, objectType.classNode);
List<DartType> replacedTypeArguments =
new List<DartType>(typeArguments.length);
new List<DartType>(type.typeArguments.length);
for (int i = 0; i < replacedTypeArguments.length; i++) {
replacedTypeArguments[i] =
replaceTopAndBottom(typeArguments[i], isCovariant: true);
replacedTypeArguments[i] = convertSuperBoundedToRegularBounded(
type.typeArguments[i],
isCovariant: isCovariant);
}
return new InterfaceType(type.classNode, replacedTypeArguments);
} else if (type is TypedefType && type.typedefNode.typeParameters != null) {
List<DartType> typeArguments = type.typeArguments ??
calculateBounds(
type.typedefNode.typeParameters, objectType.classNode);
List<DartType> replacedTypeArguments =
new List<DartType>(typeArguments.length);
new List<DartType>(type.typeArguments.length);
for (int i = 0; i < replacedTypeArguments.length; i++) {
replacedTypeArguments[i] =
replaceTopAndBottom(typeArguments[i], isCovariant: true);
replacedTypeArguments[i] = convertSuperBoundedToRegularBounded(
type.typeArguments[i],
isCovariant: isCovariant);
}
return new TypedefType(type.typedefNode, replacedTypeArguments);
} else if (type is FunctionType) {
var replacedReturnType =
replaceTopAndBottom(type.returnType, isCovariant: true);
var replacedReturnType = convertSuperBoundedToRegularBounded(
type.returnType,
isCovariant: isCovariant);
var replacedPositionalParameters =
new List<DartType>(type.positionalParameters.length);
for (int i = 0; i < replacedPositionalParameters.length; i++) {
replacedPositionalParameters[i] = replaceTopAndBottom(
replacedPositionalParameters[i] = convertSuperBoundedToRegularBounded(
type.positionalParameters[i],
isCovariant: false);
isCovariant: !isCovariant);
}
var replacedNamedParameters =
new List<NamedType>(type.namedParameters.length);
for (int i = 0; i < replacedNamedParameters.length; i++) {
replacedNamedParameters[i] = new NamedType(
type.namedParameters[i].name,
replaceTopAndBottom(type.namedParameters[i].type,
isCovariant: false));
convertSuperBoundedToRegularBounded(type.namedParameters[i].type,
isCovariant: !isCovariant));
}
return new FunctionType(replacedPositionalParameters, replacedReturnType,
namedParameters: replacedNamedParameters,
@ -209,71 +216,177 @@ class TypeEnvironment extends SubtypeTester {
return type;
}
bool isSuperBounded(DartType type) {
List<TypeParameter> typeParameters;
List<DartType> typeArguments;
// TODO(dmitryas): Remove [typedefInstantiations] when type arguments passed
// to typedefs are preserved in the Kernel output.
List<Object> findBoundViolations(DartType type,
{bool allowSuperBounded = false,
bool isCovariant = true,
Map<FunctionType, List<DartType>> typedefInstantiations}) {
List<TypeParameter> variables;
List<DartType> arguments;
List<Object> typedefRhsResult;
if (type is InterfaceType && type.classNode.typeParameters != null) {
typeParameters = type.classNode.typeParameters;
typeArguments = type.typeArguments;
} else if (type is TypedefType && type.typedefNode.typeParameters != null) {
typeParameters = type.typedefNode.typeParameters;
typeArguments = type.typeArguments;
if (typedefInstantiations != null &&
typedefInstantiations.containsKey(type)) {
// [type] is a function type that is an application of a parametrized
// typedef. We need to check both the l.h.s. and the r.h.s. of the
// definition in that case. For details, see [link]
// (https://github.com/dart-lang/sdk/blob/master/docs/language/informal/super-bounded-types.md).
FunctionType functionType = type;
FunctionType cloned = new FunctionType(
functionType.positionalParameters, functionType.returnType,
namedParameters: functionType.namedParameters,
typeParameters: functionType.typeParameters,
requiredParameterCount: functionType.requiredParameterCount,
typedefReference: null);
typedefRhsResult = findBoundViolations(cloned,
allowSuperBounded: true,
isCovariant: isCovariant,
typedefInstantiations: typedefInstantiations);
type = new TypedefType(functionType.typedef, typedefInstantiations[type]);
}
if (typeParameters == null) {
return false;
if (type is InterfaceType) {
variables = type.classNode.typeParameters;
arguments = type.typeArguments;
} else if (type is TypedefType) {
variables = type.typedefNode.typeParameters;
arguments = type.typeArguments;
} else if (type is FunctionType) {
List<Object> result = <Object>[];
for (DartType formal in type.positionalParameters) {
result.addAll(findBoundViolations(formal,
allowSuperBounded: true,
isCovariant: !isCovariant,
typedefInstantiations: typedefInstantiations) ??
const <Object>[]);
}
for (NamedType named in type.namedParameters) {
result.addAll(findBoundViolations(named.type,
allowSuperBounded: true,
isCovariant: !isCovariant,
typedefInstantiations: typedefInstantiations) ??
const <Object>[]);
}
result.addAll(findBoundViolations(type.returnType,
allowSuperBounded: true,
isCovariant: isCovariant,
typedefInstantiations: typedefInstantiations) ??
const <Object>[]);
return result.isEmpty ? null : result;
} else {
return null;
}
typeArguments =
typeArguments ?? calculateBounds(typeParameters, objectType.classNode);
if (variables == null) return null;
var substitution = <TypeParameter, DartType>{};
for (int i = 0; i < typeParameters.length; i++) {
substitution[typeParameters[i]] = typeArguments[i];
}
var substitutedBounds = new List<DartType>(typeParameters.length);
for (int i = 0; i < typeParameters.length; i++) {
substitutedBounds[i] = substitute(typeParameters[i].bound, substitution);
}
List<Object> result;
List<Object> argumentsResult;
bool isViolated = false;
for (int i = 0; i < typeArguments.length; i++) {
if (!isSubtypeOf(typeArguments[i], substitutedBounds[i])) {
isViolated = true;
Map<TypeParameter, DartType> substitutionMap =
new Map<TypeParameter, DartType>.fromIterables(variables, arguments);
for (int i = 0; i < arguments.length; ++i) {
if (!isSubtypeOf(
arguments[i], substitute(variables[i].bound, substitutionMap))) {
result ??= <Object>[];
result.add(arguments[i]);
result.add(variables[i]);
result.add(type);
}
List<Object> violations = findBoundViolations(arguments[i],
allowSuperBounded: true,
isCovariant: isCovariant,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
argumentsResult ??= <Object>[];
argumentsResult.addAll(violations);
}
}
if (!isViolated) {
return false;
if (argumentsResult != null) {
result ??= <Object>[];
result.addAll(argumentsResult);
}
if (typedefRhsResult != null) {
result ??= <Object>[];
result.addAll(typedefRhsResult);
}
var replaced = replaceTopAndBottom(type);
List<DartType> replacedArguments;
if (replaced is InterfaceType) {
replacedArguments = replaced.typeArguments;
} else if (replaced is TypedefType) {
replacedArguments = replaced.typeArguments;
}
// [type] is regular-bounded.
if (result == null) return null;
if (!allowSuperBounded) return result;
if (replacedArguments == null) {
return false;
result = null;
type = convertSuperBoundedToRegularBounded(type, isCovariant: isCovariant);
List<DartType> argumentsToReport = arguments.toList();
if (type is InterfaceType) {
variables = type.classNode.typeParameters;
arguments = type.typeArguments;
} else if (type is TypedefType) {
variables = type.typedefNode.typeParameters;
arguments = type.typeArguments;
}
var replacedSubstitution = <TypeParameter, DartType>{};
for (int i = 0; i < typeParameters.length; i++) {
replacedSubstitution[typeParameters[i]] = replacedArguments[i];
}
var replacedBounds = new List<DartType>(typeParameters.length);
for (int i = 0; i < typeParameters.length; i++) {
replacedBounds[i] =
substitute(typeParameters[i].bound, replacedSubstitution);
}
for (int i = 0; i < replacedArguments.length; i++) {
if (!isSubtypeOf(replacedArguments[i], replacedBounds[i])) {
return false;
substitutionMap =
new Map<TypeParameter, DartType>.fromIterables(variables, arguments);
for (int i = 0; i < arguments.length; ++i) {
if (!isSubtypeOf(
arguments[i], substitute(variables[i].bound, substitutionMap))) {
result ??= <Object>[];
result.add(argumentsToReport[i]);
result.add(variables[i]);
result.add(type);
}
}
return true;
if (argumentsResult != null) {
result ??= <Object>[];
result.addAll(argumentsResult);
}
if (typedefRhsResult != null) {
result ??= <Object>[];
result.addAll(typedefRhsResult);
}
return result;
}
// TODO(dmitryas): Remove [typedefInstantiations] when type arguments passed
// to typedefs are preserved in the Kernel output.
List<Object> findBoundViolationsElementwise(
List<TypeParameter> parameters, List<DartType> arguments,
{Map<FunctionType, List<DartType>> typedefInstantiations}) {
assert(arguments.length == parameters.length);
List<Object> result;
var substitutionMap = <TypeParameter, DartType>{};
for (int i = 0; i < arguments.length; ++i) {
substitutionMap[parameters[i]] = arguments[i];
}
for (int i = 0; i < arguments.length; ++i) {
if (!isSubtypeOf(
arguments[i], substitute(parameters[i].bound, substitutionMap))) {
result ??= <Object>[];
result.add(arguments[i]);
result.add(parameters[i]);
result.add(null);
}
List<Object> violations = findBoundViolations(arguments[i],
allowSuperBounded: true,
isCovariant: true,
typedefInstantiations: typedefInstantiations);
if (violations != null) {
result ??= <Object>[];
result.addAll(violations);
}
}
return result;
}
String getGenericTypeName(DartType type) {
if (type is InterfaceType) {
return type.classNode.name;
} else if (type is TypedefType) {
return type.typedefNode.name;
}
return type.toString();
}
}

View file

@ -561,7 +561,7 @@ Language/Expressions/Instance_Creation/New/execution_t11: CompileTimeError
Language/Expressions/Instance_Creation/New/execution_t13: CompileTimeError
Language/Expressions/Instance_Creation/New/named_constructor_t01: CompileTimeError
Language/Expressions/Instance_Creation/New/named_constructor_t02: CompileTimeError
Language/Expressions/Instance_Creation/New/redirecting_factory_constructor_t01: CompileTimeError # Issue 33308
Language/Expressions/Instance_Creation/New/redirecting_factory_constructor_t01: CompileTimeError
Language/Expressions/Instance_Creation/New/redirecting_factory_constructor_t02: CompileTimeError
Language/Expressions/Instance_Creation/New/type_argument_t01: CompileTimeError
Language/Expressions/Instance_Creation/New/type_t01: CompileTimeError

View file

@ -216,8 +216,8 @@ LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t09: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t19: CompileTimeError # Issue 33995
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t01: MissingCompileTimeError # Issue 33995
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t02: MissingCompileTimeError # Issue 33308
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t01: MissingCompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t02: MissingCompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/mixin/mixin_neg_l1_t02: MissingCompileTimeError # Issue 33596
LanguageFeatures/Instantiate-to-bound/typedef/typedef_named_extends_neg_l2_t02: MissingCompileTimeError # Bad test
LanguageFeatures/Instantiate-to-bound/typedef/typedef_named_extends_pos_l2_t01: CompileTimeError # Bad test

View file

@ -3509,8 +3509,6 @@ Language/Types/Interface_Types/subtype_t06: RuntimeError
Language/Types/Interface_Types/subtype_t21: RuntimeError
Language/Types/Interface_Types/subtype_t23: RuntimeError
Language/Variables/constant_variable_t09: RuntimeError
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t04: MissingCompileTimeError
@ -3522,15 +3520,8 @@ LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t10: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/check_types/typedef_param_t02: RuntimeError
LanguageFeatures/Instantiate-to-bound/class/class_extends_neg_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t06: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t13: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t15: MissingCompileTimeError
LanguageFeatures/Subtyping/dynamic/generated/named_function_types_fail_arguments_binding_fail_A51_t01: RuntimeError
LanguageFeatures/Subtyping/dynamic/generated/named_function_types_fail_arguments_binding_fail_A51_t02: RuntimeError
LanguageFeatures/Subtyping/dynamic/generated/named_function_types_fail_arguments_binding_fail_A53_t01: RuntimeError

View file

@ -160,13 +160,7 @@ Language/Expressions/Function_Invocation/async_cleanup_t08: CompileTimeError
Language/Expressions/Instance_Creation/Const/arguments_t03: MissingCompileTimeError # Legal because of implicit const
Language/Expressions/Instance_Creation/Const/parameterized_type_t01: CompileTimeError
Language/Expressions/Instance_Creation/Const/parameterized_type_t02: CompileTimeError
Language/Expressions/Instance_Creation/New/evaluation_t16: MissingCompileTimeError # Issue 33308
Language/Expressions/Instance_Creation/New/evaluation_t17: MissingCompileTimeError # Issue 33308
Language/Expressions/Instance_Creation/New/evaluation_t18: MissingCompileTimeError # Issue 33308
Language/Expressions/Instance_Creation/New/redirecting_factory_constructor_t02: MissingCompileTimeError # Issue 33308
Language/Expressions/Instance_Creation/New/syntax_t04: MissingCompileTimeError # Legal because of implicit new
Language/Expressions/Instance_Creation/New/type_argument_t01: MissingCompileTimeError # Issue 33308
Language/Expressions/Instance_Creation/malformed_or_malbounded_t07: MissingCompileTimeError # Issue 33308
Language/Expressions/Lists/constant_list_t01: CompileTimeError
Language/Expressions/Maps/constant_map_t02: MissingCompileTimeError
Language/Expressions/Maps/constant_map_type_t01: CompileTimeError
@ -191,10 +185,8 @@ Language/Expressions/Unary_Expressions/syntax_t10: CompileTimeError
Language/Expressions/Unary_Expressions/syntax_t27: CompileTimeError
Language/Functions/Formal_Parameters/Optional_Formals/default_value_t01: MissingCompileTimeError # 32912
Language/Functions/Formal_Parameters/Optional_Formals/default_value_t02: MissingCompileTimeError # 32912
Language/Generics/scope_t06: MissingCompileTimeError # Issue 33308
Language/Generics/syntax_t02: CompileTimeError
Language/Generics/syntax_t03: CompileTimeError
Language/Generics/upper_bound_t01: MissingCompileTimeError # Issue 33308
Language/Libraries_and_Scripts/Imports/library_name_t01: MissingCompileTimeError # Expects an error, but this is a warning in Dart 2
Language/Mixins/Mixin_Application/deferred_t01: MissingCompileTimeError # Issue 30273
Language/Mixins/Mixin_Application/static_warning_t01: MissingCompileTimeError # Mixin super equirement
@ -223,51 +215,8 @@ Language/Statements/Continue/label_t07: MissingCompileTimeError # Issue 34206
Language/Statements/Switch/equal_operator_t01: MissingCompileTimeError # Issue 32557
Language/Statements/Switch/equal_operator_t02: MissingCompileTimeError # Issue 32557
Language/Statements/Try/catch_scope_t01: CompileTimeError
Language/Types/Dynamic_Type_System/malbounded_type_error_t01: MissingCompileTimeError # Issue 33308
Language/Types/Interface_Types/subtype_t30: CompileTimeError
Language/Types/Parameterized_Types/malbounded_t01: MissingCompileTimeError # Issue 33308
Language/Types/Parameterized_Types/malbounded_t02: MissingCompileTimeError # Issue 33308
Language/Types/Parameterized_Types/malbounded_t03: MissingCompileTimeError # Issue 33308
Language/Types/Parameterized_Types/malbounded_t04: MissingCompileTimeError # Issue 33308
Language/Types/Parameterized_Types/malbounded_t05: MissingCompileTimeError # Issue 33308
Language/Types/Parameterized_Types/malbounded_t06: MissingCompileTimeError # Issue 33308
Language/Types/Static_Types/malformed_type_t01/04: MissingCompileTimeError # Issue 33308
Language/Types/Static_Types/malformed_type_t01/05: MissingCompileTimeError # Issue 33308
Language/Types/Static_Types/malformed_type_t01/06: MissingCompileTimeError # Issue 33308
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t01: MissingCompileTimeError # Please triage this failure
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t03: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t04: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t05: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t06: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t07: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t08: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t09: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t10: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t11: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_named_extends_neg_assign_l1_t12: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t01: MissingCompileTimeError # Please triage this failure
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t03: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t04: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t05: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t06: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t07: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t08: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t09: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t10: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t11: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_optparam_extends_neg_assign_l1_t12: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t01: MissingCompileTimeError # Please triage this failure
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t03: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t04: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t05: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t06: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t07: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t08: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t09: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t10: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t11: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_param_extends_neg_assign_l1_t12: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t01: MissingCompileTimeError # Issue 33308
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t01: MissingCompileTimeError # Issue 34637
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t03: MissingCompileTimeError # Issue 33805
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t04: MissingCompileTimeError # Issue 33805
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t05: MissingCompileTimeError # Issue 33805
@ -276,62 +225,23 @@ LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t08: MissingCompileTimeError # Issue 33597
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t09: MissingCompileTimeError # Issue 33597
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t10: MissingCompileTimeError # Issue 33597
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t12: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t13: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t14: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t15: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t16: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t17: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t18: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t19: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t20: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/Callable/Callable_ret_extends_neg_assign_l1_t21: MissingCompileTimeError # Issue 34087
LanguageFeatures/Instantiate-to-bound/check_types/typedef_param_t02: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/class/class_extends_FutureOr_pos_l1_t01: CompileTimeError # Issue 34626
LanguageFeatures/Instantiate-to-bound/class/class_extends_neg_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/class/custom_extends_neg_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t06: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t06: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t09: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t06: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t06: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t09: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t06: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t06: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t09: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_pos_l1_t05: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_pos_l1_t06: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_neg_assign_l1_t10: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_pos_l1_t05: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_pos_l1_t06: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_pos_l1_t05: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_Future_pos_l1_t06: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_neg_assign_l1_t10: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_pos_l1_t05: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_optparam_extends_pos_l1_t06: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_Future_pos_l1_t05: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_neg_assign_l1_t10: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_param_extends_pos_l1_t05: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_pos_l1_t01: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t03: MissingCompileTimeError
@ -341,16 +251,7 @@ LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_a
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t09: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t11: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t12: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t13: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t14: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t15: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t16: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t17: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t18: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t20: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t21: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t19: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t03: MissingCompileTimeError
@ -360,32 +261,20 @@ LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t08: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t09: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t11: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t12: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t13: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t14: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t15: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t16: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t17: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t18: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t20: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t21: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_assign_l1_t19: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_neg_l1_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t01: MissingCompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/interface/interface_neg_assign_l2_t02: MissingCompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/mixin/mixin_extends_neg_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/mixin/mixin_neg_assign_l2_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/mixin/mixin_neg_l1_t07: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/mixin/mixin_neg_l2_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_named_extends_neg_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_named_extends_neg_l2_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_optparam_extends_neg_l1_t03: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_named_extends_pos_l2_t01: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/typedef/typedef_optparam_extends_neg_l2_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_param_extends_neg_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_optparam_extends_pos_l2_t01: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/typedef/typedef_param_extends_neg_l2_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_ret_extends_neg_l1_t04: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_param_extends_pos_l2_t01: CompileTimeError # Issue 34613
LanguageFeatures/Instantiate-to-bound/typedef/typedef_ret_extends_neg_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_ret_extends_neg_l2_t02: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/typedef/typedef_ret_extends_pos_l2_t01: CompileTimeError # Issue 34613
LanguageFeatures/Super_Mixins/declarations_neg_t01/none: CompileTimeError
LanguageFeatures/Super_Mixins/mixin_application_neg_t01/none: CompileTimeError
LanguageFeatures/Super_Mixins/mixin_application_neg_t03/none: CompileTimeError
@ -590,7 +479,6 @@ LibTest/isolate/ReceivePort/transform_A01_t01: RuntimeError
[ $runtime != vm && $fasta ]
Language/Classes/Constructors/Constant_Constructors/potentially_constant_expression_t01: MissingCompileTimeError # Issue 34192
LanguageFeatures/Instantiate-to-bound/class/class_extends_FutureOr_neg_l3_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/class/class_extends_Future_neg_l3_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/class/class_extends_neg_l3_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/mixin/mixin_neg_l1_t02: MissingCompileTimeError
@ -803,8 +691,6 @@ Language/Variables/constant_initialization_t03: RuntimeError
Language/Variables/constant_variable_t09: RuntimeError
LanguageFeatures/Instantiate-to-bound/check_types/typedef_param_t02: RuntimeError
LanguageFeatures/Instantiate-to-bound/class/class_extends_neg_l1_t05: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_named_extends_Future_neg_assign_l1_t01: MissingCompileTimeError
LanguageFeatures/Instantiate-to-bound/function/function_ret_extends_Future_neg_assign_l1_t21: MissingCompileTimeError
LanguageFeatures/Super_Mixins/mixin_application_neg_t01/none: CompileTimeError
LibTest/async/Future/asStream_A01_t02: RuntimeError
LibTest/async/Stream/Stream.fromFutures_A04_t02: RuntimeError

View file

@ -613,7 +613,7 @@ Future testTypeVariableSubtype() async {
new B();
new C();
new D();
new E<num, int>();
new E<int, num>();
new F();
}
""", expectNoErrors: true).then((env) {

View file

@ -30,7 +30,6 @@ external_test/10: CompileTimeError # External non-js-interop function are treate
external_test/13: CompileTimeError # External non-js-interop function are treated as compile-time errors.
external_test/20: CompileTimeError # External non-js-interop function are treated as compile-time errors.
function_propagation_test: RuntimeError
generic_test/01: MissingCompileTimeError # front end does not validate `extends`
guess_cid_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
identical_closure2_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
instantiate_tearoff_of_call_test: RuntimeError
@ -452,7 +451,6 @@ identical_const_test/01: MissingCompileTimeError
identical_const_test/02: MissingCompileTimeError
identical_const_test/03: MissingCompileTimeError
identical_const_test/04: MissingCompileTimeError
issue18628_2_test/01: MissingCompileTimeError
issue23244_test: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
library_env_test/has_no_html_support: RuntimeError
library_env_test/has_no_io_support: RuntimeError
@ -467,7 +465,6 @@ regress_13462_1_test: RuntimeError
regress_18535_test: RuntimeError
type_literal_prefix_call_test/00: MissingCompileTimeError
type_promotion_logical_and_test/01: MissingCompileTimeError
type_variable_bounds_test/02: Crash # NoSuchMethodError: The method 'accept' was called on null.
[ $compiler == dart2js && $minified ]
cyclic_type2_test: RuntimeError # Issue 31054
@ -504,7 +501,6 @@ identical_const_test/03: MissingCompileTimeError
identical_const_test/04: MissingCompileTimeError
invocation_mirror2_test: RuntimeError # mirrors not supported
invocation_mirror_test: RuntimeError
issue18628_2_test/01: MissingCompileTimeError
issue23244_test: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
library_env_test/has_no_html_support: RuntimeError
many_overridden_no_such_method_test: RuntimeError
@ -524,7 +520,6 @@ stack_trace_test: RuntimeError, OK # Stack trace not preserved in minified code.
symbol_conflict_test: RuntimeError # Issue 23857
type_literal_prefix_call_test/00: MissingCompileTimeError
type_promotion_logical_and_test/01: MissingCompileTimeError
type_variable_bounds_test/02: Crash # NoSuchMethodError: The method 'accept' was called on null.
[ $compiler == dart2js && $strong ]
async_await_test/02: RuntimeError

View file

@ -272,7 +272,6 @@ generic_function_bounds_test: RuntimeError
generic_methods_generic_function_result_test/01: MissingCompileTimeError
generic_no_such_method_dispatcher_simple_test: CompileTimeError # Warning: Superclass has no method named 'foo'.
generic_no_such_method_dispatcher_test: CompileTimeError # Issue 31533
generic_test/01: MissingCompileTimeError # front end does not validate `extends`
identical_const_test/01: MissingCompileTimeError
identical_const_test/02: MissingCompileTimeError
identical_const_test/03: MissingCompileTimeError
@ -289,14 +288,12 @@ implicit_creation/implicit_const_not_default_values_test/e30: Pass
implicit_creation/implicit_const_not_default_values_test/e6: Pass
implicit_creation/implicit_const_not_default_values_test/e9: Pass
instantiate_tearoff_of_call_test: CompileTimeError
issue18628_2_test/01: MissingCompileTimeError
issue31596_super_test/01: CompileTimeError
issue31596_super_test/03: CompileTimeError
issue31596_super_test/05: RuntimeError
map_literal3_test/01: MissingCompileTimeError
map_literal3_test/02: MissingCompileTimeError
map_literal3_test/03: MissingCompileTimeError
mixin_declaration/mixin_declaration_inference_invalid_07_test: MissingCompileTimeError # https://github.com/dart-lang/sdk/issues/34165
mixin_declaration/mixin_declaration_invalid_override_test/08: MissingCompileTimeError
mixin_declaration/mixin_declaration_invalid_syntax_test/none: CompileTimeError
mixin_declaration/mixin_declaration_invalid_usage_test/03: MissingCompileTimeError

View file

@ -71,7 +71,6 @@ generic_is_check_test: RuntimeError
generic_no_such_method_dispatcher_simple_test: CompileTimeError
generic_no_such_method_dispatcher_test: CompileTimeError
generic_tearoff_test: CompileTimeError
generic_test/01: MissingCompileTimeError
instantiate_tearoff_of_call_test: CompileTimeError
issue31596_super_test/01: CompileTimeError
issue31596_super_test/03: CompileTimeError
@ -174,7 +173,6 @@ assertion_initializer_const_error2_test/cc09: MissingCompileTimeError
assertion_initializer_const_error2_test/cc10: MissingCompileTimeError
const_cast1_test/02: MissingCompileTimeError
const_constructor_nonconst_param_test/01: MissingCompileTimeError
generic_test/01: MissingCompileTimeError
implicit_creation/implicit_const_not_default_values_test/e1: MissingCompileTimeError
implicit_creation/implicit_const_not_default_values_test/e10: MissingCompileTimeError
implicit_creation/implicit_const_not_default_values_test/e11: MissingCompileTimeError
@ -211,16 +209,13 @@ constructor_reference_test/27: MissingCompileTimeError # Issue 34403
deferred_inheritance_constraints_test/extends: MissingCompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 30273.
deferred_inheritance_constraints_test/implements: MissingCompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 30273.
deferred_inheritance_constraints_test/mixin: MissingCompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 30273.
f_bounded_quantification_test/01: MissingCompileTimeError # Issue 33308
f_bounded_quantification_test/02: MissingCompileTimeError # Issue 33308
generic_methods_bounds_test/01: MissingCompileTimeError # Issue 33308
generic_methods_recursive_bound_test/02: MissingCompileTimeError # Issue 33308
instantiate_to_bounds_super_bounded_test/14: MissingCompileTimeError # Issue 33308
instantiate_to_bounds_super_bounded_test/15: MissingCompileTimeError # Issue 33308
instantiate_to_bounds_super_bounded_test/17: MissingCompileTimeError # Issue 33308
instantiate_to_bounds_super_bounded_test/18: MissingCompileTimeError # Issue 33308
instantiate_to_bounds_super_bounded_test/20: MissingCompileTimeError # Issue 33308
instantiate_to_bounds_super_bounded_test/21: MissingCompileTimeError # Issue 33308
f_bounded_quantification2_test: CompileTimeError # Issue 34583
f_bounded_quantification4_test: CompileTimeError # Issue 34583
instantiate_to_bounds_super_bounded_test/54: CompileTimeError # Issue 34613
instantiate_to_bounds_super_bounded_test/55: CompileTimeError # Issue 34613
instantiate_to_bounds_super_bounded_test/56: CompileTimeError # Issue 34613
instantiate_to_bounds_super_bounded_test/57: CompileTimeError # Issue 34613
instantiate_to_bounds_super_bounded_test/58: CompileTimeError # Issue 34613
issue31596_super_test/02: MissingCompileTimeError # Issue 31596
issue31596_super_test/04: MissingCompileTimeError # Issue 31596
issue34488_test/01: MissingCompileTimeError # Issue 34488
@ -229,23 +224,6 @@ issue34488_test/03: MissingCompileTimeError # Issue 34488
issue34488_test/04: MissingCompileTimeError # Issue 34488
issue34488_test/05: MissingCompileTimeError # Issue 34488
issue34488_test/06: MissingCompileTimeError # Issue 34488
issue34532_test: MissingCompileTimeError # Issue 33308
malbounded_instantiation_test/01: MissingCompileTimeError # Issue 33308
malbounded_instantiation_test/02: MissingCompileTimeError # Issue 33308
malbounded_instantiation_test/03: MissingCompileTimeError # Issue 33308
malbounded_redirecting_factory_test/03: MissingCompileTimeError # Issue 33308
malbounded_redirecting_factory_test/04: MissingCompileTimeError # Issue 33308
malbounded_redirecting_factory_test/05: MissingCompileTimeError # Issue 33308
malbounded_type_cast2_test: MissingCompileTimeError # Issue 33308
malbounded_type_cast_test/00: MissingCompileTimeError # Issue 33308
malbounded_type_cast_test/01: MissingCompileTimeError # Issue 33308
malbounded_type_cast_test/02: MissingCompileTimeError # Issue 33308
malbounded_type_literal_test/00: MissingCompileTimeError # Issue 33308
malbounded_type_test2_test/00: MissingCompileTimeError # Issue 33308
malbounded_type_test_test/00: MissingCompileTimeError # Issue 33308
malbounded_type_test_test/01: MissingCompileTimeError # Issue 33308
malbounded_type_test_test/02: MissingCompileTimeError # Issue 33308
mixin_declaration/mixin_declaration_inference_invalid_07_test: MissingCompileTimeError
mixin_declaration/mixin_declaration_invalid_application_supertype_test/05: MissingCompileTimeError
mixin_declaration/mixin_declaration_invalid_application_supertype_test/06: MissingCompileTimeError
mixin_declaration/mixin_declaration_invalid_application_supertype_test/07: MissingCompileTimeError
@ -256,32 +234,7 @@ mixin_declaration/mixin_declaration_superinvocation_application_test/05: Missing
mixin_declaration/mixin_declaration_superinvocation_application_test/06: MissingCompileTimeError
mixin_declaration/mixin_declaration_superinvocation_application_test/07: MissingCompileTimeError
mixin_declaration/mixin_declaration_superinvocation_application_test/08: MissingCompileTimeError
mixin_invalid_bound2_test/02: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/03: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/04: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/05: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/06: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/07: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/08: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/09: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/10: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/11: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/12: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/13: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/14: MissingCompileTimeError # Issue 33308
mixin_invalid_bound2_test/15: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/02: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/03: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/04: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/05: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/06: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/07: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/08: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/09: MissingCompileTimeError # Issue 33308
mixin_invalid_bound_test/10: MissingCompileTimeError # Issue 33308
mixin_method_override_test/G5: Crash # Issue 34354
mixin_super_bound_test/01: MissingCompileTimeError # Issue 33308
mixin_super_bound_test/02: MissingCompileTimeError # Issue 33308
regress_22976_test/*: CompileTimeError # Issue 31935
syntax_test/28: MissingCompileTimeError # Issue 29763 - low priority
syntax_test/29: MissingCompileTimeError # Issue 29763 - low priority
@ -291,18 +244,6 @@ syntax_test/32: MissingCompileTimeError # Issue 29763 - low priority
syntax_test/33: MissingCompileTimeError # Issue 29763 - low priority
syntax_test/60: MissingCompileTimeError # Issue 30470
syntax_test/61: MissingCompileTimeError # Issue 30470
type_variable_bounds2_test: MissingCompileTimeError # Issue 33308
type_variable_bounds3_test/00: MissingCompileTimeError # Issue 33308
type_variable_bounds4_test/01: MissingCompileTimeError # Issue 33308
type_variable_bounds_test/01: MissingCompileTimeError # Issue 33308
type_variable_bounds_test/02: MissingCompileTimeError # Issue 33308
type_variable_bounds_test/03: MissingCompileTimeError # Issue 33308
type_variable_bounds_test/04: MissingCompileTimeError # Issue 33308
type_variable_bounds_test/05: MissingCompileTimeError # Issue 33308
type_variable_bounds_test/06: MissingCompileTimeError # Issue 33308
typedef_check_bounds_generic_test: MissingCompileTimeError
typedef_check_bounds_test: MissingCompileTimeError
typedef_check_bounds_unused_test: MissingCompileTimeError
vm/debug_break_enabled_vm_test/01: CompileTimeError # KernelVM bug: Bad test using extended break syntax.
vm/debug_break_enabled_vm_test/none: CompileTimeError # KernelVM bug: Bad test using extended break syntax.
vm/regress_27201_test: CompileTimeError # Fasta/KernelVM bug: Deferred loading kernel issue 30273.
@ -476,21 +417,13 @@ generic_methods_generic_function_parameter_test: Pass # Issue 25869
generic_methods_new_test: Pass # Issue 25869
generic_methods_test: Pass # Issue 25869
known_identifier_usage_error_test/none: RuntimeError # Issue 28814
malbounded_redirecting_factory_test/03: Fail
malbounded_redirecting_factory_test/04: Fail
malbounded_type_test_test/03: Fail
malbounded_type_test_test/04: Fail
mixin_invalid_bound2_test/08: Fail
mixin_invalid_bound2_test/09: Fail
mixin_invalid_bound2_test/10: Fail
mixin_invalid_bound_test/06: Fail
mixin_invalid_bound_test/07: Fail
recursive_inheritance_test: RuntimeError
redirecting_factory_infinite_steps_test/01: Fail
redirecting_factory_malbounded_test/01: Fail
regress_22728_test: Fail # Dartk Issue 28498
regress_22728_test: RuntimeError
type_variable_bounds4_test/01: RuntimeError
[ $compiler == dartkp && $runtime == dart_precompiled && !$checked && $strong ]
assertion_initializer_const_error_test/01: MissingCompileTimeError
@ -613,7 +546,6 @@ instantiate_tearoff_of_call_test: CompileTimeError
invocation_mirror2_test: SkipByDesign
invocation_mirror_invoke_on2_test: SkipByDesign
invocation_mirror_invoke_on_test: SkipByDesign
issue18628_2_test/01: MissingCompileTimeError
issue21079_test: SkipByDesign
issue31596_super_test/01: CompileTimeError
issue31596_super_test/03: CompileTimeError
@ -1088,17 +1020,12 @@ assert_initializer_test/48: MissingCompileTimeError # KernelVM bug: Constant eva
assert_initializer_test/none: RuntimeError # KernelVM bug: Constant evaluation.
async_return_types_test/nestedFuture: Fail
compile_time_constant_checked_test/02: MissingCompileTimeError
malbounded_redirecting_factory_test/03: Fail
malbounded_redirecting_factory_test/04: Fail
malbounded_type_test_test/03: Fail
malbounded_type_test_test/04: Fail
mixin_invalid_bound2_test/08: Fail
mixin_invalid_bound2_test/09: Fail
mixin_invalid_bound2_test/10: Fail
mixin_invalid_bound_test/06: Fail
mixin_invalid_bound_test/07: Fail
regress_30339_test: RuntimeError
type_variable_bounds4_test/01: RuntimeError
[ $runtime == vm && !$checked && $strong && ($compiler == dartk || $compiler == dartkb) ]
conditional_rewrite_test: RuntimeError # Issue 31402 (Not)
@ -1168,7 +1095,6 @@ generic_no_such_method_dispatcher_test: CompileTimeError # Issue 31533
generic_tearoff_test: CompileTimeError, RuntimeError
if_null_evaluation_order_test: Pass
instantiate_tearoff_of_call_test: CompileTimeError
issue18628_2_test/01: MissingCompileTimeError
issue31596_super_test/01: CompileTimeError
issue31596_super_test/03: CompileTimeError
issue31596_super_test/05: RuntimeError
@ -1245,8 +1171,6 @@ assertion_initializer_const_error2_test/cc09: Pass # Works in --checked mode but
assertion_initializer_const_error2_test/cc10: Pass # Works in --checked mode but not in --strong mode.
[ $fasta && $strong ]
issue18628_2_test/01: MissingCompileTimeError
redirecting_factory_bounds_test/02: MissingCompileTimeError # Related to issue 33308
type_promotion_logical_and_test/01: MissingCompileTimeError
[ $fasta && !$strong ]
@ -2072,4 +1996,3 @@ async_star_test/none: Skip # Timeout
[ $compiler == dartk || $compiler == dartkb || $compiler == dartkp ]
generic_function_bounds_test: RuntimeError # Issue 32076
generic_test/01: MissingCompileTimeError

View file

@ -34,15 +34,13 @@ isolate/browser/*: Skip # TODO(ahe): Make dart:html available.
js/*: Skip # TODO(ahe): Make dart:js available.
[ $fasta ]
async/future_or_type_test: CompileTimeError # Issue 34626
mirrors/deferred_constraints_constants_test/default_argument2: MissingCompileTimeError
mirrors/generic_bounded_by_type_parameter_test/02: MissingCompileTimeError
mirrors/generic_bounded_test/01: MissingCompileTimeError
mirrors/generic_bounded_test/02: MissingCompileTimeError
mirrors/generic_interface_test/01: MissingCompileTimeError
mirrors/generic_f_bounded_mixin_application_test: CompileTimeError # Issue 34613
mirrors/metadata_allowed_values_test/13: MissingCompileTimeError
mirrors/metadata_allowed_values_test/14: MissingCompileTimeError
mirrors/redirecting_factory_test/01: CompileTimeError # Issue 33308
mirrors/redirecting_factory_test/none: CompileTimeError # Issue 33308
mirrors/redirecting_factory_test/01: CompileTimeError # Issue 34714
mirrors/redirecting_factory_test/none: CompileTimeError # Issue 34714
[ $arch == simarm64 && $strong && ($compiler == dartk || $compiler == dartkb) ]
isolate/mint_maker_test: Timeout # Please triage.
@ -166,7 +164,6 @@ mirrors/function_apply_test: RuntimeError, OK
mirrors/function_type_mirror_test: RuntimeError
mirrors/generic_f_bounded_mixin_application_test: RuntimeError
mirrors/generic_function_typedef_test: RuntimeError
mirrors/generic_interface_test/01: RuntimeError
mirrors/generic_mixin_applications_test: RuntimeError
mirrors/invocation_fuzz_test: RuntimeError, Crash
mirrors/library_declarations_test/none: RuntimeError # Issue 31402 (Invocation arguments)