mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 14:53:37 +00:00
[cfe] Create various matcher in the body builder
This add the Expression-, Binary-, Cast-, NullAssert-, NullCheck-, List- and RelationalMatcher and creates these during body building. The IfCaseStatement is added to support propagation of these to the inference visitor. Change-Id: Ia9add15e504cb06af711efc1697a00b8e235e1a4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263128 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This commit is contained in:
parent
e7c590b137
commit
8995807b2b
|
@ -56,6 +56,7 @@ enum NullValue {
|
||||||
IdentifierList,
|
IdentifierList,
|
||||||
Initializers,
|
Initializers,
|
||||||
Labels,
|
Labels,
|
||||||
|
Matcher,
|
||||||
Metadata,
|
Metadata,
|
||||||
MixinApplicationBuilder,
|
MixinApplicationBuilder,
|
||||||
MatcherList,
|
MatcherList,
|
||||||
|
|
|
@ -674,17 +674,14 @@ class BodyBuilder extends StackListenerImpl
|
||||||
} else if (node is Binder) {
|
} else if (node is Binder) {
|
||||||
return new BinderMatcher(node);
|
return new BinderMatcher(node);
|
||||||
} else if (node is Generator) {
|
} else if (node is Generator) {
|
||||||
// TODO(johnniwinther): Generate matcher from Generator.
|
return new ExpressionMatcher(node.buildSimpleRead());
|
||||||
return new DummyMatcher();
|
|
||||||
} else if (node is Expression) {
|
} else if (node is Expression) {
|
||||||
// TODO(johnniwinther): Generate matcher from Expression.
|
return new ExpressionMatcher(node);
|
||||||
return new DummyMatcher();
|
|
||||||
} else if (node is ProblemBuilder) {
|
} else if (node is ProblemBuilder) {
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
Expression expression =
|
Expression expression =
|
||||||
buildProblem(node.message, node.charOffset, noLength);
|
buildProblem(node.message, node.charOffset, noLength);
|
||||||
// TODO(johnniwinther): Generate matcher from Expression.
|
return new ExpressionMatcher(expression);
|
||||||
return new DummyMatcher();
|
|
||||||
} else {
|
} else {
|
||||||
return unhandled("${node.runtimeType}", "toMatcher", -1, uri);
|
return unhandled("${node.runtimeType}", "toMatcher", -1, uri);
|
||||||
}
|
}
|
||||||
|
@ -2280,6 +2277,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void handleParenthesizedCondition(Token token, Token? case_, Token? when) {
|
void handleParenthesizedCondition(Token token, Token? case_, Token? when) {
|
||||||
|
debugEvent("ParenthesizedCondition");
|
||||||
if (case_ != null) {
|
if (case_ != null) {
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
Expression? guard;
|
Expression? guard;
|
||||||
|
@ -2317,20 +2315,22 @@ class BodyBuilder extends StackListenerImpl
|
||||||
]));
|
]));
|
||||||
reportIfNotEnabled(
|
reportIfNotEnabled(
|
||||||
libraryFeatures.patterns, case_.charOffset, case_.charCount);
|
libraryFeatures.patterns, case_.charOffset, case_.charCount);
|
||||||
// ignore: unused_local_variable
|
|
||||||
Matcher matcher = toMatcher(pop());
|
Matcher matcher = toMatcher(pop());
|
||||||
// TODO(johnniwinther): Create an if-case statement.
|
Expression expression = popForValue();
|
||||||
|
push(new Condition(expression, matcher));
|
||||||
|
} else {
|
||||||
|
assert(checkState(token, [
|
||||||
|
unionOfKinds([
|
||||||
|
ValueKinds.Expression,
|
||||||
|
ValueKinds.Generator,
|
||||||
|
ValueKinds.ProblemBuilder,
|
||||||
|
]),
|
||||||
|
]));
|
||||||
|
push(new Condition(popForValue()));
|
||||||
}
|
}
|
||||||
assert(checkState(token, [
|
assert(checkState(token, [
|
||||||
unionOfKinds([
|
ValueKinds.Condition,
|
||||||
ValueKinds.Expression,
|
|
||||||
ValueKinds.Generator,
|
|
||||||
ValueKinds.ProblemBuilder,
|
|
||||||
]),
|
|
||||||
]));
|
]));
|
||||||
debugEvent("ParenthesizedCondition");
|
|
||||||
push(popForValue());
|
|
||||||
assert(checkState(token, [ValueKinds.Expression]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -2667,7 +2667,24 @@ class BodyBuilder extends StackListenerImpl
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
Matcher right = toMatcher(pop());
|
Matcher right = toMatcher(pop());
|
||||||
// TODO(johnniwinther): Create a binary matcher.
|
// TODO(johnniwinther): Create a binary matcher.
|
||||||
push(new DummyMatcher());
|
|
||||||
|
String operator = token.lexeme;
|
||||||
|
BinaryMatcherKind kind;
|
||||||
|
switch (operator) {
|
||||||
|
case '&':
|
||||||
|
kind = BinaryMatcherKind.and;
|
||||||
|
break;
|
||||||
|
case '|':
|
||||||
|
kind = BinaryMatcherKind.or;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
internalProblem(
|
||||||
|
fasta.templateInternalProblemUnhandled
|
||||||
|
.withArguments(operator, 'endBinaryPattern'),
|
||||||
|
token.charOffset,
|
||||||
|
uri);
|
||||||
|
}
|
||||||
|
push(new BinaryMatcher(left, kind, right, token.charOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
void doBinaryExpression(Token token) {
|
void doBinaryExpression(Token token) {
|
||||||
|
@ -3446,11 +3463,9 @@ class BodyBuilder extends StackListenerImpl
|
||||||
@override
|
@override
|
||||||
void beginThenStatement(Token token) {
|
void beginThenStatement(Token token) {
|
||||||
debugEvent("beginThenStatement");
|
debugEvent("beginThenStatement");
|
||||||
Expression condition = popForValue();
|
|
||||||
// This is matched by the call to [deferNode] in
|
// This is matched by the call to [deferNode] in
|
||||||
// [endThenStatement].
|
// [endThenStatement].
|
||||||
typeInferrer.assignedVariables.beginNode();
|
typeInferrer.assignedVariables.beginNode();
|
||||||
push(condition);
|
|
||||||
enterLocalScope("then");
|
enterLocalScope("then");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3468,13 +3483,27 @@ class BodyBuilder extends StackListenerImpl
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void endIfStatement(Token ifToken, Token? elseToken) {
|
void endIfStatement(Token ifToken, Token? elseToken) {
|
||||||
|
assert(checkState(ifToken, [
|
||||||
|
/* else = */ if (elseToken != null) ValueKinds.Statement,
|
||||||
|
ValueKinds.AssignedVariablesNodeInfo,
|
||||||
|
/* then = */ ValueKinds.Statement,
|
||||||
|
/* condition = */ ValueKinds.Condition,
|
||||||
|
]));
|
||||||
Statement? elsePart = popStatementIfNotNull(elseToken);
|
Statement? elsePart = popStatementIfNotNull(elseToken);
|
||||||
AssignedVariablesNodeInfo assignedVariablesInfo =
|
AssignedVariablesNodeInfo assignedVariablesInfo =
|
||||||
pop() as AssignedVariablesNodeInfo;
|
pop() as AssignedVariablesNodeInfo;
|
||||||
Statement thenPart = popStatement();
|
Statement thenPart = popStatement();
|
||||||
Expression condition = pop() as Expression;
|
Condition condition = pop() as Condition;
|
||||||
Statement node = forest.createIfStatement(
|
Matcher? matcher = condition.matcher;
|
||||||
offsetForToken(ifToken), condition, thenPart, elsePart);
|
Expression expression = condition.expression;
|
||||||
|
Statement node;
|
||||||
|
if (matcher != null) {
|
||||||
|
node = new IfCaseStatement(
|
||||||
|
expression, matcher, thenPart, elsePart, ifToken.charOffset);
|
||||||
|
} else {
|
||||||
|
node = forest.createIfStatement(
|
||||||
|
offsetForToken(ifToken), expression, thenPart, elsePart);
|
||||||
|
}
|
||||||
// This is matched by the call to [deferNode] in
|
// This is matched by the call to [deferNode] in
|
||||||
// [endThenStatement].
|
// [endThenStatement].
|
||||||
typeInferrer.assignedVariables.storeInfo(node, assignedVariablesInfo);
|
typeInferrer.assignedVariables.storeInfo(node, assignedVariablesInfo);
|
||||||
|
@ -4132,14 +4161,32 @@ class BodyBuilder extends StackListenerImpl
|
||||||
reportIfNotEnabled(libraryFeatures.patterns, leftBracket.charOffset,
|
reportIfNotEnabled(libraryFeatures.patterns, leftBracket.charOffset,
|
||||||
leftBracket.charCount);
|
leftBracket.charCount);
|
||||||
|
|
||||||
for (int i = 0; i < count; i++) {
|
List<Matcher> matchers =
|
||||||
// ignore: unused_local_variable
|
new List<Matcher>.filled(count, dummyMatcher, growable: true);
|
||||||
Matcher element = toMatcher(pop());
|
for (int i = count - 1; i >= 0; i--) {
|
||||||
|
matchers[i] = toMatcher(pop());
|
||||||
}
|
}
|
||||||
// ignore: unused_local_variable
|
|
||||||
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
|
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
|
||||||
// TODO(johnniwinther): Create list matcher.
|
DartType typeArgument;
|
||||||
push(new DummyMatcher());
|
if (typeArguments != null) {
|
||||||
|
if (typeArguments.length > 1) {
|
||||||
|
addProblem(
|
||||||
|
fasta.messageListLiteralTooManyTypeArguments,
|
||||||
|
offsetForToken(leftBracket),
|
||||||
|
lengthOfSpan(leftBracket, leftBracket.endGroup));
|
||||||
|
typeArgument = const InvalidType();
|
||||||
|
} else {
|
||||||
|
typeArgument = buildDartType(
|
||||||
|
typeArguments.single, TypeUse.literalTypeArgument,
|
||||||
|
allowPotentiallyConstantType: false);
|
||||||
|
typeArgument = instantiateToBounds(
|
||||||
|
typeArgument, coreTypes.objectClass, libraryBuilder.library);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
typeArgument = implicitTypeArgument;
|
||||||
|
}
|
||||||
|
|
||||||
|
push(new ListMatcher(typeArgument, matchers, leftBracket.charOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -4231,7 +4278,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
List<Object?>? elements =
|
List<Object?>? elements =
|
||||||
const FixedNullableList<Object>().pop(stack, count);
|
const FixedNullableList<Object>().pop(stack, count);
|
||||||
// TODO(johnniwinther): Create a record matcher.
|
// TODO(johnniwinther): Create a record matcher.
|
||||||
push(new DummyMatcher());
|
push(new DummyMatcher(token.charOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
void buildLiteralSet(List<TypeBuilder>? typeArguments, Token? constKeyword,
|
void buildLiteralSet(List<TypeBuilder>? typeArguments, Token? constKeyword,
|
||||||
|
@ -4381,7 +4428,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
Matcher value = toMatcher(pop());
|
Matcher value = toMatcher(pop());
|
||||||
// TODO(johnniwinther): Create map entry.
|
// TODO(johnniwinther): Create map entry.
|
||||||
push(new DummyMatcher());
|
push(new DummyMatcher(colon.charOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -4410,7 +4457,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
}
|
}
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
|
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
|
||||||
push(new DummyMatcher());
|
push(new DummyMatcher(leftBrace.charOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -4807,13 +4854,10 @@ class BodyBuilder extends StackListenerImpl
|
||||||
]));
|
]));
|
||||||
reportIfNotEnabled(
|
reportIfNotEnabled(
|
||||||
libraryFeatures.patterns, operator.charOffset, operator.charCount);
|
libraryFeatures.patterns, operator.charOffset, operator.charCount);
|
||||||
// ignore: unused_local_variable
|
|
||||||
DartType type = buildDartType(pop() as TypeBuilder, TypeUse.asType,
|
DartType type = buildDartType(pop() as TypeBuilder, TypeUse.asType,
|
||||||
allowPotentiallyConstantType: libraryBuilder.isNonNullableByDefault);
|
allowPotentiallyConstantType: libraryBuilder.isNonNullableByDefault);
|
||||||
// ignore: unused_local_variable
|
|
||||||
Matcher operand = toMatcher(pop());
|
Matcher operand = toMatcher(pop());
|
||||||
// TODO(johnniwinther): Create a cast matcher.
|
push(new CastMatcher(operand, type, operator.charOffset));
|
||||||
push(new DummyMatcher());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -6190,12 +6234,10 @@ class BodyBuilder extends StackListenerImpl
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void handleThenControlFlow(Token token) {
|
void handleThenControlFlow(Token token) {
|
||||||
Expression condition = popForValue();
|
|
||||||
// This is matched by the call to [deferNode] in
|
// This is matched by the call to [deferNode] in
|
||||||
// [handleElseControlFlow] and by the call to [endNode] in
|
// [handleElseControlFlow] and by the call to [endNode] in
|
||||||
// [endIfControlFlow].
|
// [endIfControlFlow].
|
||||||
typeInferrer.assignedVariables.beginNode();
|
typeInferrer.assignedVariables.beginNode();
|
||||||
push(condition);
|
|
||||||
super.handleThenControlFlow(token);
|
super.handleThenControlFlow(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6215,18 +6257,31 @@ class BodyBuilder extends StackListenerImpl
|
||||||
@override
|
@override
|
||||||
void endIfControlFlow(Token token) {
|
void endIfControlFlow(Token token) {
|
||||||
debugEvent("endIfControlFlow");
|
debugEvent("endIfControlFlow");
|
||||||
|
assert(checkState(token, [
|
||||||
|
unionOfKinds([
|
||||||
|
ValueKinds.Expression,
|
||||||
|
ValueKinds.Generator,
|
||||||
|
ValueKinds.ProblemBuilder,
|
||||||
|
ValueKinds.MapLiteralEntry,
|
||||||
|
]),
|
||||||
|
ValueKinds.Condition,
|
||||||
|
ValueKinds.Token,
|
||||||
|
]));
|
||||||
|
|
||||||
Object? entry = pop();
|
Object? entry = pop();
|
||||||
Object? condition = pop(); // parenthesized expression
|
Condition condition = pop() as Condition;
|
||||||
|
assert(condition.matcher == null,
|
||||||
|
"Unexpected matcher in control flow if: ${condition.matcher}.");
|
||||||
Token ifToken = pop() as Token;
|
Token ifToken = pop() as Token;
|
||||||
|
|
||||||
transformCollections = true;
|
transformCollections = true;
|
||||||
TreeNode node;
|
TreeNode node;
|
||||||
if (entry is MapLiteralEntry) {
|
if (entry is MapLiteralEntry) {
|
||||||
node = forest.createIfMapEntry(
|
node = forest.createIfMapEntry(
|
||||||
offsetForToken(ifToken), toValue(condition), entry);
|
offsetForToken(ifToken), condition.expression, entry);
|
||||||
} else {
|
} else {
|
||||||
node = forest.createIfElement(
|
node = forest.createIfElement(
|
||||||
offsetForToken(ifToken), toValue(condition), toValue(entry));
|
offsetForToken(ifToken), condition.expression, toValue(entry));
|
||||||
}
|
}
|
||||||
push(node);
|
push(node);
|
||||||
// This is matched by the call to [beginNode] in
|
// This is matched by the call to [beginNode] in
|
||||||
|
@ -6237,25 +6292,45 @@ class BodyBuilder extends StackListenerImpl
|
||||||
@override
|
@override
|
||||||
void endIfElseControlFlow(Token token) {
|
void endIfElseControlFlow(Token token) {
|
||||||
debugEvent("endIfElseControlFlow");
|
debugEvent("endIfElseControlFlow");
|
||||||
|
assert(checkState(token, [
|
||||||
|
/* else element */ unionOfKinds([
|
||||||
|
ValueKinds.Expression,
|
||||||
|
ValueKinds.Generator,
|
||||||
|
ValueKinds.ProblemBuilder,
|
||||||
|
ValueKinds.MapLiteralEntry,
|
||||||
|
]),
|
||||||
|
/* then element */ unionOfKinds([
|
||||||
|
ValueKinds.Expression,
|
||||||
|
ValueKinds.Generator,
|
||||||
|
ValueKinds.ProblemBuilder,
|
||||||
|
ValueKinds.MapLiteralEntry,
|
||||||
|
]),
|
||||||
|
ValueKinds.AssignedVariablesNodeInfo,
|
||||||
|
ValueKinds.Condition,
|
||||||
|
ValueKinds.Token,
|
||||||
|
]));
|
||||||
|
|
||||||
Object? elseEntry = pop(); // else entry
|
Object? elseEntry = pop(); // else entry
|
||||||
Object? thenEntry = pop(); // then entry
|
Object? thenEntry = pop(); // then entry
|
||||||
AssignedVariablesNodeInfo assignedVariablesInfo =
|
AssignedVariablesNodeInfo assignedVariablesInfo =
|
||||||
pop() as AssignedVariablesNodeInfo;
|
pop() as AssignedVariablesNodeInfo;
|
||||||
Object? condition = pop(); // parenthesized expression
|
Condition condition = pop() as Condition; // parenthesized expression
|
||||||
|
assert(condition.matcher == null,
|
||||||
|
"Unexpected matcher in control flow if: ${condition.matcher}.");
|
||||||
Token ifToken = pop() as Token;
|
Token ifToken = pop() as Token;
|
||||||
|
|
||||||
transformCollections = true;
|
transformCollections = true;
|
||||||
TreeNode node;
|
TreeNode node;
|
||||||
if (thenEntry is MapLiteralEntry) {
|
if (thenEntry is MapLiteralEntry) {
|
||||||
if (elseEntry is MapLiteralEntry) {
|
if (elseEntry is MapLiteralEntry) {
|
||||||
node = forest.createIfMapEntry(
|
node = forest.createIfMapEntry(offsetForToken(ifToken),
|
||||||
offsetForToken(ifToken), toValue(condition), thenEntry, elseEntry);
|
condition.expression, thenEntry, elseEntry);
|
||||||
} else if (elseEntry is ControlFlowElement) {
|
} else if (elseEntry is ControlFlowElement) {
|
||||||
MapLiteralEntry? elseMapEntry = elseEntry
|
MapLiteralEntry? elseMapEntry = elseEntry
|
||||||
.toMapLiteralEntry(typeInferrer.assignedVariables.reassignInfo);
|
.toMapLiteralEntry(typeInferrer.assignedVariables.reassignInfo);
|
||||||
if (elseMapEntry != null) {
|
if (elseMapEntry != null) {
|
||||||
node = forest.createIfMapEntry(offsetForToken(ifToken),
|
node = forest.createIfMapEntry(offsetForToken(ifToken),
|
||||||
toValue(condition), thenEntry, elseMapEntry);
|
condition.expression, thenEntry, elseMapEntry);
|
||||||
} else {
|
} else {
|
||||||
int offset = elseEntry.fileOffset;
|
int offset = elseEntry.fileOffset;
|
||||||
node = new MapLiteralEntry(
|
node = new MapLiteralEntry(
|
||||||
|
@ -6280,7 +6355,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
.toMapLiteralEntry(typeInferrer.assignedVariables.reassignInfo);
|
.toMapLiteralEntry(typeInferrer.assignedVariables.reassignInfo);
|
||||||
if (thenMapEntry != null) {
|
if (thenMapEntry != null) {
|
||||||
node = forest.createIfMapEntry(offsetForToken(ifToken),
|
node = forest.createIfMapEntry(offsetForToken(ifToken),
|
||||||
toValue(condition), thenMapEntry, elseEntry);
|
condition.expression, thenMapEntry, elseEntry);
|
||||||
} else {
|
} else {
|
||||||
int offset = thenEntry.fileOffset;
|
int offset = thenEntry.fileOffset;
|
||||||
node = new MapLiteralEntry(
|
node = new MapLiteralEntry(
|
||||||
|
@ -6300,8 +6375,8 @@ class BodyBuilder extends StackListenerImpl
|
||||||
..fileOffset = offsetForToken(ifToken);
|
..fileOffset = offsetForToken(ifToken);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
node = forest.createIfElement(offsetForToken(ifToken), toValue(condition),
|
node = forest.createIfElement(offsetForToken(ifToken),
|
||||||
toValue(thenEntry), toValue(elseEntry));
|
condition.expression, toValue(thenEntry), toValue(elseEntry));
|
||||||
}
|
}
|
||||||
push(node);
|
push(node);
|
||||||
// This is matched by the call to [deferNode] in
|
// This is matched by the call to [deferNode] in
|
||||||
|
@ -6641,7 +6716,16 @@ class BodyBuilder extends StackListenerImpl
|
||||||
void endDoWhileStatement(
|
void endDoWhileStatement(
|
||||||
Token doKeyword, Token whileKeyword, Token endToken) {
|
Token doKeyword, Token whileKeyword, Token endToken) {
|
||||||
debugEvent("DoWhileStatement");
|
debugEvent("DoWhileStatement");
|
||||||
Expression condition = popForValue();
|
assert(checkState(doKeyword, [
|
||||||
|
/* condition = */ ValueKinds.Condition,
|
||||||
|
/* body = */ ValueKinds.Statement,
|
||||||
|
/* continue target = */ ValueKinds.ContinueTarget,
|
||||||
|
/* break target = */ ValueKinds.BreakTarget,
|
||||||
|
]));
|
||||||
|
Condition condition = pop() as Condition;
|
||||||
|
assert(condition.matcher == null,
|
||||||
|
"Unexpected matcher in do statement: ${condition.matcher}.");
|
||||||
|
Expression expression = condition.expression;
|
||||||
Statement body = popStatement();
|
Statement body = popStatement();
|
||||||
JumpTarget continueTarget = exitContinueTarget()!;
|
JumpTarget continueTarget = exitContinueTarget()!;
|
||||||
JumpTarget breakTarget = exitBreakTarget()!;
|
JumpTarget breakTarget = exitBreakTarget()!;
|
||||||
|
@ -6653,7 +6737,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
body = labeledStatement;
|
body = labeledStatement;
|
||||||
}
|
}
|
||||||
Statement doStatement =
|
Statement doStatement =
|
||||||
forest.createDoStatement(offsetForToken(doKeyword), body, condition);
|
forest.createDoStatement(offsetForToken(doKeyword), body, expression);
|
||||||
// This is matched by the [beginNode] call in [beginDoWhileStatement].
|
// This is matched by the [beginNode] call in [beginDoWhileStatement].
|
||||||
typeInferrer.assignedVariables.endNode(doStatement);
|
typeInferrer.assignedVariables.endNode(doStatement);
|
||||||
if (continueStatements != null) {
|
if (continueStatements != null) {
|
||||||
|
@ -6971,8 +7055,17 @@ class BodyBuilder extends StackListenerImpl
|
||||||
@override
|
@override
|
||||||
void endWhileStatement(Token whileKeyword, Token endToken) {
|
void endWhileStatement(Token whileKeyword, Token endToken) {
|
||||||
debugEvent("WhileStatement");
|
debugEvent("WhileStatement");
|
||||||
|
assert(checkState(whileKeyword, [
|
||||||
|
/* body = */ ValueKinds.Statement,
|
||||||
|
/* condition = */ ValueKinds.Condition,
|
||||||
|
/* continue target = */ ValueKinds.ContinueTarget,
|
||||||
|
/* break target = */ ValueKinds.BreakTarget,
|
||||||
|
]));
|
||||||
Statement body = popStatement();
|
Statement body = popStatement();
|
||||||
Expression condition = popForValue();
|
Condition condition = pop() as Condition;
|
||||||
|
assert(condition.matcher == null,
|
||||||
|
"Unexpected matcher in while statement: ${condition.matcher}.");
|
||||||
|
Expression expression = condition.expression;
|
||||||
JumpTarget continueTarget = exitContinueTarget()!;
|
JumpTarget continueTarget = exitContinueTarget()!;
|
||||||
JumpTarget breakTarget = exitBreakTarget()!;
|
JumpTarget breakTarget = exitBreakTarget()!;
|
||||||
List<BreakStatementImpl>? continueStatements;
|
List<BreakStatementImpl>? continueStatements;
|
||||||
|
@ -6983,7 +7076,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
body = labeledStatement;
|
body = labeledStatement;
|
||||||
}
|
}
|
||||||
Statement whileStatement = forest.createWhileStatement(
|
Statement whileStatement = forest.createWhileStatement(
|
||||||
offsetForToken(whileKeyword), condition, body);
|
offsetForToken(whileKeyword), expression, body);
|
||||||
if (continueStatements != null) {
|
if (continueStatements != null) {
|
||||||
for (BreakStatementImpl continueStatement in continueStatements) {
|
for (BreakStatementImpl continueStatement in continueStatements) {
|
||||||
continueStatement.targetStatement = whileStatement;
|
continueStatement.targetStatement = whileStatement;
|
||||||
|
@ -7179,12 +7272,21 @@ class BodyBuilder extends StackListenerImpl
|
||||||
@override
|
@override
|
||||||
void endSwitchStatement(Token switchKeyword, Token endToken) {
|
void endSwitchStatement(Token switchKeyword, Token endToken) {
|
||||||
debugEvent("SwitchStatement");
|
debugEvent("SwitchStatement");
|
||||||
|
assert(checkState(switchKeyword, [
|
||||||
|
/* cases = */ ValueKinds.SwitchCaseList,
|
||||||
|
/* break target = */ ValueKinds.BreakTarget,
|
||||||
|
/* switch scope = */ ValueKinds.SwitchScopeOrNull,
|
||||||
|
/* local scope = */ ValueKinds.Scope,
|
||||||
|
/* expression = */ ValueKinds.Condition,
|
||||||
|
]));
|
||||||
List<SwitchCase> cases = pop() as List<SwitchCase>;
|
List<SwitchCase> cases = pop() as List<SwitchCase>;
|
||||||
JumpTarget target = exitBreakTarget()!;
|
JumpTarget target = exitBreakTarget()!;
|
||||||
exitSwitchScope();
|
exitSwitchScope();
|
||||||
exitLocalScope();
|
exitLocalScope();
|
||||||
Expression expression = popForValue();
|
Condition condition = pop() as Condition;
|
||||||
|
assert(condition.matcher == null,
|
||||||
|
"Unexpected matcher in switch statement: ${condition.matcher}.");
|
||||||
|
Expression expression = condition.expression;
|
||||||
Statement switchStatement = new SwitchStatement(expression, cases)
|
Statement switchStatement = new SwitchStatement(expression, cases)
|
||||||
..fileOffset = switchKeyword.charOffset;
|
..fileOffset = switchKeyword.charOffset;
|
||||||
Statement result = switchStatement;
|
Statement result = switchStatement;
|
||||||
|
@ -8113,7 +8215,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
|
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
|
||||||
|
|
||||||
// TODO(johnniwinther): Create extractor pattern.
|
// TODO(johnniwinther): Create extractor pattern.
|
||||||
push(new DummyMatcher());
|
push(new DummyMatcher(firstIdentifier.charOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -8130,10 +8232,36 @@ class BodyBuilder extends StackListenerImpl
|
||||||
]));
|
]));
|
||||||
reportIfNotEnabled(
|
reportIfNotEnabled(
|
||||||
libraryFeatures.patterns, token.charOffset, token.charCount);
|
libraryFeatures.patterns, token.charOffset, token.charCount);
|
||||||
// ignore: unused_local_variable
|
Expression operand = toValue(pop());
|
||||||
Matcher operand = toMatcher(pop());
|
RelationalMatcherKind kind;
|
||||||
// TODO(johnniwinther): Create a relational matcher.
|
String operator = token.lexeme;
|
||||||
push(new DummyMatcher());
|
switch (operator) {
|
||||||
|
case '==':
|
||||||
|
kind = RelationalMatcherKind.equals;
|
||||||
|
break;
|
||||||
|
case '!=':
|
||||||
|
kind = RelationalMatcherKind.notEquals;
|
||||||
|
break;
|
||||||
|
case '<':
|
||||||
|
kind = RelationalMatcherKind.lessThan;
|
||||||
|
break;
|
||||||
|
case '<=':
|
||||||
|
kind = RelationalMatcherKind.lessThanEqual;
|
||||||
|
break;
|
||||||
|
case '>':
|
||||||
|
kind = RelationalMatcherKind.greaterThan;
|
||||||
|
break;
|
||||||
|
case '>=':
|
||||||
|
kind = RelationalMatcherKind.greaterThanEqual;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
internalProblem(
|
||||||
|
fasta.templateInternalProblemUnhandled
|
||||||
|
.withArguments(operator, 'handleRelationalPattern'),
|
||||||
|
token.charOffset,
|
||||||
|
uri);
|
||||||
|
}
|
||||||
|
push(new RelationalMatcher(kind, operand, token.charOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -8150,10 +8278,8 @@ class BodyBuilder extends StackListenerImpl
|
||||||
]));
|
]));
|
||||||
reportIfNotEnabled(
|
reportIfNotEnabled(
|
||||||
libraryFeatures.patterns, bang.charOffset, bang.charCount);
|
libraryFeatures.patterns, bang.charOffset, bang.charCount);
|
||||||
// ignore: unused_local_variable
|
|
||||||
Matcher operand = toMatcher(pop());
|
Matcher operand = toMatcher(pop());
|
||||||
// TODO(johnniwinther): Create a relational matcher.
|
push(new NullAssertMatcher(operand, bang.charOffset));
|
||||||
push(new DummyMatcher());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -8172,8 +8298,7 @@ class BodyBuilder extends StackListenerImpl
|
||||||
libraryFeatures.patterns, question.charOffset, question.charCount);
|
libraryFeatures.patterns, question.charOffset, question.charCount);
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
Matcher operand = toMatcher(pop());
|
Matcher operand = toMatcher(pop());
|
||||||
// TODO(johnniwinther): Create a relational matcher.
|
push(new NullCheckMatcher(operand, question.charOffset));
|
||||||
push(new DummyMatcher());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -8205,23 +8330,30 @@ class BodyBuilder extends StackListenerImpl
|
||||||
if (colon != null) ValueKinds.IdentifierOrNull,
|
if (colon != null) ValueKinds.IdentifierOrNull,
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
// ignore: unused_local_variable
|
||||||
Object? value = pop();
|
Object? value = pop();
|
||||||
if (value is Binder) {
|
if (value is Binder) {
|
||||||
// TODO(johnniwinther): Create (named) binder.
|
// TODO(johnniwinther): Create (named) binder.
|
||||||
|
if (colon != null) {
|
||||||
|
// ignore: unused_local_variable
|
||||||
|
Identifier? name = pop() as Identifier?;
|
||||||
|
// TODO(johnniwinther): Push named binder.
|
||||||
|
push(new DummyMatcher(colon.charOffset));
|
||||||
|
} else {
|
||||||
|
push(value);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO(johnniwinther): Create (named) matcher.
|
// TODO(johnniwinther): Create (named) matcher.
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
Matcher matcher = toMatcher(value);
|
Matcher matcher = toMatcher(value);
|
||||||
}
|
if (colon != null) {
|
||||||
// ignore: unused_local_variable
|
// ignore: unused_local_variable
|
||||||
Identifier? name;
|
Identifier? name = pop() as Identifier?;
|
||||||
if (colon != null) {
|
// TODO(johnniwinther): Push named binder.
|
||||||
name = pop() as Identifier?;
|
push(new DummyMatcher(colon.charOffset));
|
||||||
// TODO(johnniwinther): Push named binder/matcher.
|
} else {
|
||||||
push(new DummyMatcher());
|
push(matcher);
|
||||||
} else {
|
}
|
||||||
// TODO(johnniwinther): Push binder/matcher.
|
|
||||||
push(new DummyMatcher());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8660,3 +8792,14 @@ class _FindChildVisitor extends Visitor<void> with VisitorVoidMixin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Condition {
|
||||||
|
final Expression expression;
|
||||||
|
final Matcher? matcher;
|
||||||
|
|
||||||
|
Condition(this.expression, [this.matcher]);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() =>
|
||||||
|
'Condition($expression${matcher != null ? ',$matcher' : ''})';
|
||||||
|
}
|
||||||
|
|
|
@ -5011,8 +5011,16 @@ class InternalRecordLiteral extends InternalExpression {
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class Matcher extends TreeNode {
|
abstract class Matcher extends TreeNode {
|
||||||
|
Matcher(int fileOffset) {
|
||||||
|
this.fileOffset = fileOffset;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
R accept<R>(TreeVisitor<R> visitor) {
|
R accept<R>(TreeVisitor<R> visitor) {
|
||||||
|
if (visitor is Printer || visitor is Precedence || visitor is Transformer) {
|
||||||
|
// Allow visitors needed for toString and replaceWith.
|
||||||
|
return visitor.defaultTreeNode(this);
|
||||||
|
}
|
||||||
return unsupported(
|
return unsupported(
|
||||||
"${runtimeType}.accept on ${visitor.runtimeType}", -1, null);
|
"${runtimeType}.accept on ${visitor.runtimeType}", -1, null);
|
||||||
}
|
}
|
||||||
|
@ -5042,6 +5050,8 @@ abstract class Matcher extends TreeNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
class DummyMatcher extends Matcher {
|
class DummyMatcher extends Matcher {
|
||||||
|
DummyMatcher(int fileOffset) : super(fileOffset);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void toTextInternal(AstPrinter printer) {}
|
void toTextInternal(AstPrinter printer) {}
|
||||||
|
|
||||||
|
@ -5051,10 +5061,211 @@ class DummyMatcher extends Matcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A [Matcher] based on an [Expression]. This corresponds to a constant
|
||||||
|
/// matcher (pattern) in the specification.
|
||||||
|
class ExpressionMatcher extends Matcher {
|
||||||
|
Expression expression;
|
||||||
|
|
||||||
|
ExpressionMatcher(this.expression) : super(expression.fileOffset) {
|
||||||
|
expression.parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
expression.toTextInternal(printer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "ExpressionMatcher(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum BinaryMatcherKind {
|
||||||
|
and,
|
||||||
|
or,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A [Matcher] for `matcher | matcher` and `matcher & matcher`.
|
||||||
|
class BinaryMatcher extends Matcher {
|
||||||
|
Matcher left;
|
||||||
|
BinaryMatcherKind kind;
|
||||||
|
Matcher right;
|
||||||
|
|
||||||
|
BinaryMatcher(this.left, this.kind, this.right, int fileOffset)
|
||||||
|
: super(fileOffset) {
|
||||||
|
left.parent = this;
|
||||||
|
right.parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
left.toTextInternal(printer);
|
||||||
|
switch (kind) {
|
||||||
|
case BinaryMatcherKind.and:
|
||||||
|
printer.write(' & ');
|
||||||
|
break;
|
||||||
|
case BinaryMatcherKind.or:
|
||||||
|
printer.write(' | ');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
right.toTextInternal(printer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "BinaryMatcher(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A [Matcher] for `matcher as type`.
|
||||||
|
class CastMatcher extends Matcher {
|
||||||
|
Matcher matcher;
|
||||||
|
DartType type;
|
||||||
|
|
||||||
|
CastMatcher(this.matcher, this.type, int fileOffset) : super(fileOffset) {
|
||||||
|
matcher.parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
matcher.toTextInternal(printer);
|
||||||
|
printer.write(' as ');
|
||||||
|
printer.writeType(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "CastMatcher(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A [Matcher] for `matcher!`.
|
||||||
|
class NullAssertMatcher extends Matcher {
|
||||||
|
Matcher matcher;
|
||||||
|
|
||||||
|
NullAssertMatcher(this.matcher, int fileOffset) : super(fileOffset) {
|
||||||
|
matcher.parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
matcher.toTextInternal(printer);
|
||||||
|
printer.write('!');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "NullAssertMatcher(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A [Matcher] for `matcher?`.
|
||||||
|
class NullCheckMatcher extends Matcher {
|
||||||
|
Matcher matcher;
|
||||||
|
|
||||||
|
NullCheckMatcher(this.matcher, int fileOffset) : super(fileOffset) {
|
||||||
|
matcher.parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
matcher.toTextInternal(printer);
|
||||||
|
printer.write('?');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "NullCheckMatcher(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A [Matcher] for `<typeArgument>[matcher0, ... matcherN]`.
|
||||||
|
class ListMatcher extends Matcher {
|
||||||
|
DartType typeArgument;
|
||||||
|
List<Matcher> matchers;
|
||||||
|
|
||||||
|
ListMatcher(this.typeArgument, this.matchers, int fileOffset)
|
||||||
|
: super(fileOffset) {
|
||||||
|
setParents(matchers, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
printer.write('<');
|
||||||
|
printer.writeType(typeArgument);
|
||||||
|
printer.write('>');
|
||||||
|
printer.write('[');
|
||||||
|
String comma = '';
|
||||||
|
for (Matcher matcher in matchers) {
|
||||||
|
printer.write(comma);
|
||||||
|
matcher.toTextInternal(printer);
|
||||||
|
comma = ', ';
|
||||||
|
}
|
||||||
|
printer.write(']');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "ListMatcher(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum RelationalMatcherKind {
|
||||||
|
equals,
|
||||||
|
notEquals,
|
||||||
|
lessThan,
|
||||||
|
lessThanEqual,
|
||||||
|
greaterThan,
|
||||||
|
greaterThanEqual,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A [Matcher] for `operator expression` where `operator is either ==, !=,
|
||||||
|
/// <, <=, >, or >=.
|
||||||
|
class RelationalMatcher extends Matcher {
|
||||||
|
final RelationalMatcherKind kind;
|
||||||
|
Expression expression;
|
||||||
|
|
||||||
|
RelationalMatcher(this.kind, this.expression, int fileOffset)
|
||||||
|
: super(fileOffset) {
|
||||||
|
expression.parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
switch (kind) {
|
||||||
|
case RelationalMatcherKind.equals:
|
||||||
|
printer.write('== ');
|
||||||
|
break;
|
||||||
|
case RelationalMatcherKind.notEquals:
|
||||||
|
printer.write('!= ');
|
||||||
|
break;
|
||||||
|
case RelationalMatcherKind.lessThan:
|
||||||
|
printer.write('< ');
|
||||||
|
break;
|
||||||
|
case RelationalMatcherKind.lessThanEqual:
|
||||||
|
printer.write('<= ');
|
||||||
|
break;
|
||||||
|
case RelationalMatcherKind.greaterThan:
|
||||||
|
printer.write('> ');
|
||||||
|
break;
|
||||||
|
case RelationalMatcherKind.greaterThanEqual:
|
||||||
|
printer.write('>= ');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
printer.writeExpression(expression);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "RelationalMatcher(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class BinderMatcher extends Matcher {
|
class BinderMatcher extends Matcher {
|
||||||
final Binder binder;
|
final Binder binder;
|
||||||
|
|
||||||
BinderMatcher(this.binder);
|
BinderMatcher(this.binder) : super(binder.fileOffset);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void toTextInternal(AstPrinter printer) {
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
@ -5247,3 +5458,62 @@ class PatternVariableDeclaration extends Statement {
|
||||||
return "PatternVariableDeclaration(${toStringInternal()})";
|
return "PatternVariableDeclaration(${toStringInternal()})";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final Matcher dummyMatcher = new ExpressionMatcher(dummyExpression);
|
||||||
|
|
||||||
|
class IfCaseStatement extends InternalStatement {
|
||||||
|
Expression expression;
|
||||||
|
Matcher matcher;
|
||||||
|
Statement then;
|
||||||
|
Statement? otherwise;
|
||||||
|
|
||||||
|
IfCaseStatement(this.expression, this.matcher, this.then, this.otherwise,
|
||||||
|
int fileOffset) {
|
||||||
|
this.fileOffset = fileOffset;
|
||||||
|
expression.parent = this;
|
||||||
|
matcher.parent = this;
|
||||||
|
then.parent = this;
|
||||||
|
otherwise?.parent = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
StatementInferenceResult acceptInference(InferenceVisitorImpl visitor) {
|
||||||
|
return visitor.visitIfCaseStatement(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
printer.write('if (');
|
||||||
|
printer.writeExpression(expression);
|
||||||
|
printer.write(' case ');
|
||||||
|
matcher.toTextInternal(printer);
|
||||||
|
printer.write(') ');
|
||||||
|
printer.writeStatement(then);
|
||||||
|
if (otherwise != null) {
|
||||||
|
printer.write(' else ');
|
||||||
|
printer.writeStatement(otherwise!);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void transformChildren(Transformer v) {
|
||||||
|
unsupported(
|
||||||
|
"${runtimeType}.transformChildren on ${v.runtimeType}", -1, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void transformOrRemoveChildren(RemovingTransformer v) {
|
||||||
|
unsupported("${runtimeType}.transformOrRemoveChildren on ${v.runtimeType}",
|
||||||
|
-1, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void visitChildren(Visitor v) {
|
||||||
|
unsupported("${runtimeType}.visitChildren on ${v.runtimeType}", -1, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return "IfCaseStatement(${toStringInternal()})";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -12,6 +12,9 @@ import 'package:_fe_analyzer_shared/src/parser/value_kind.dart';
|
||||||
import 'package:_fe_analyzer_shared/src/scanner/scanner.dart' as type
|
import 'package:_fe_analyzer_shared/src/scanner/scanner.dart' as type
|
||||||
show Token;
|
show Token;
|
||||||
|
|
||||||
|
import 'package:_fe_analyzer_shared/src/type_inference/assigned_variables.dart'
|
||||||
|
as type;
|
||||||
|
|
||||||
import 'package:kernel/ast.dart' as type;
|
import 'package:kernel/ast.dart' as type;
|
||||||
|
|
||||||
import '../builder/formal_parameter_builder.dart' as type;
|
import '../builder/formal_parameter_builder.dart' as type;
|
||||||
|
@ -23,7 +26,8 @@ import '../builder/type_variable_builder.dart' as type;
|
||||||
|
|
||||||
import '../identifiers.dart' as type;
|
import '../identifiers.dart' as type;
|
||||||
|
|
||||||
import '../kernel/body_builder.dart' as type show FormalParameters;
|
import '../kernel/body_builder.dart' as type
|
||||||
|
show Condition, FormalParameters, JumpTarget;
|
||||||
import '../kernel/expression_generator.dart' as type;
|
import '../kernel/expression_generator.dart' as type;
|
||||||
import '../kernel/internal_ast.dart' as type;
|
import '../kernel/internal_ast.dart' as type;
|
||||||
|
|
||||||
|
@ -45,14 +49,21 @@ class ValueKinds {
|
||||||
static const ValueKind Arguments = const SingleValueKind<type.Arguments>();
|
static const ValueKind Arguments = const SingleValueKind<type.Arguments>();
|
||||||
static const ValueKind ArgumentsOrNull =
|
static const ValueKind ArgumentsOrNull =
|
||||||
const SingleValueKind<type.Arguments>(NullValue.Arguments);
|
const SingleValueKind<type.Arguments>(NullValue.Arguments);
|
||||||
|
static const ValueKind AssignedVariablesNodeInfo =
|
||||||
|
const SingleValueKind<type.AssignedVariablesNodeInfo>();
|
||||||
static const ValueKind AsyncMarker =
|
static const ValueKind AsyncMarker =
|
||||||
const SingleValueKind<type.AsyncMarker>();
|
const SingleValueKind<type.AsyncMarker>();
|
||||||
static const ValueKind AsyncModifier =
|
static const ValueKind AsyncModifier =
|
||||||
const SingleValueKind<type.AsyncMarker>();
|
const SingleValueKind<type.AsyncMarker>();
|
||||||
static const ValueKind Binder = const SingleValueKind<type.Binder>();
|
static const ValueKind Binder = const SingleValueKind<type.Binder>();
|
||||||
|
static const ValueKind BreakTarget =
|
||||||
|
const SingleValueKind<type.JumpTarget>(NullValue.BreakTarget);
|
||||||
static const ValueKind Bool = const SingleValueKind<bool>();
|
static const ValueKind Bool = const SingleValueKind<bool>();
|
||||||
|
static const ValueKind Condition = const SingleValueKind<type.Condition>();
|
||||||
static const ValueKind ConstantContext =
|
static const ValueKind ConstantContext =
|
||||||
const SingleValueKind<type.ConstantContext>();
|
const SingleValueKind<type.ConstantContext>();
|
||||||
|
static const ValueKind ContinueTarget =
|
||||||
|
const SingleValueKind<type.JumpTarget>(NullValue.ContinueTarget);
|
||||||
static const ValueKind Expression = const SingleValueKind<type.Expression>();
|
static const ValueKind Expression = const SingleValueKind<type.Expression>();
|
||||||
static const ValueKind ExpressionOrNull =
|
static const ValueKind ExpressionOrNull =
|
||||||
const SingleValueKind<type.Expression>(NullValue.Expression);
|
const SingleValueKind<type.Expression>(NullValue.Expression);
|
||||||
|
@ -75,6 +86,8 @@ class ValueKinds {
|
||||||
static const ValueKind MapLiteralEntry =
|
static const ValueKind MapLiteralEntry =
|
||||||
const SingleValueKind<type.MapLiteralEntry>();
|
const SingleValueKind<type.MapLiteralEntry>();
|
||||||
static const ValueKind Matcher = const SingleValueKind<type.Matcher>();
|
static const ValueKind Matcher = const SingleValueKind<type.Matcher>();
|
||||||
|
static const ValueKind MatcherOrNull =
|
||||||
|
const SingleValueKind<type.Matcher>(NullValue.Matcher);
|
||||||
static const ValueKind MatcherListOrNull =
|
static const ValueKind MatcherListOrNull =
|
||||||
const SingleValueKind<List<type.Matcher>>(NullValue.MatcherList);
|
const SingleValueKind<List<type.Matcher>>(NullValue.MatcherList);
|
||||||
static const ValueKind MethodBody = const SingleValueKind<type.MethodBody>();
|
static const ValueKind MethodBody = const SingleValueKind<type.MethodBody>();
|
||||||
|
@ -125,6 +138,8 @@ class ValueKinds {
|
||||||
NullValue.RecordTypeFieldList);
|
NullValue.RecordTypeFieldList);
|
||||||
static const ValueKind Scope = const SingleValueKind<type.Scope>();
|
static const ValueKind Scope = const SingleValueKind<type.Scope>();
|
||||||
static const ValueKind Selector = const SingleValueKind<type.Selector>();
|
static const ValueKind Selector = const SingleValueKind<type.Selector>();
|
||||||
|
static const ValueKind SwitchCaseList =
|
||||||
|
const SingleValueKind<List<type.SwitchCase>>();
|
||||||
static const ValueKind SwitchScopeOrNull =
|
static const ValueKind SwitchScopeOrNull =
|
||||||
const SingleValueKind<type.Scope>(NullValue.SwitchScope);
|
const SingleValueKind<type.Scope>(NullValue.SwitchScope);
|
||||||
static const ValueKind Statement = const SingleValueKind<type.Statement>();
|
static const ValueKind Statement = const SingleValueKind<type.Statement>();
|
||||||
|
|
|
@ -1801,6 +1801,12 @@ class InferenceVisitorImpl extends InferenceVisitorBase
|
||||||
return const StatementInferenceResult();
|
return const StatementInferenceResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatementInferenceResult visitIfCaseStatement(IfCaseStatement node) {
|
||||||
|
// TODO(cstefantsova): Handle if-case statements.
|
||||||
|
return new StatementInferenceResult.single(
|
||||||
|
new EmptyStatement()..fileOffset = node.fileOffset);
|
||||||
|
}
|
||||||
|
|
||||||
ExpressionInferenceResult visitIntJudgment(
|
ExpressionInferenceResult visitIntJudgment(
|
||||||
IntJudgment node, DartType typeContext) {
|
IntJudgment node, DartType typeContext) {
|
||||||
if (isDoubleContext(typeContext)) {
|
if (isDoubleContext(typeContext)) {
|
||||||
|
|
|
@ -42,6 +42,16 @@ void testExpression(Expression node, String normal,
|
||||||
"Unexpected limited strategy text for ${node.runtimeType}");
|
"Unexpected limited strategy text for ${node.runtimeType}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testMatcher(Matcher node, String normal,
|
||||||
|
{String? verbose, String? limited}) {
|
||||||
|
Expect.stringEquals(normal, node.toText(normalStrategy),
|
||||||
|
"Unexpected normal strategy text for ${node.runtimeType}");
|
||||||
|
Expect.stringEquals(verbose ?? normal, node.toText(verboseStrategy),
|
||||||
|
"Unexpected verbose strategy text for ${node.runtimeType}");
|
||||||
|
Expect.stringEquals(limited ?? normal, node.toText(limitedStrategy),
|
||||||
|
"Unexpected limited strategy text for ${node.runtimeType}");
|
||||||
|
}
|
||||||
|
|
||||||
final Uri dummyUri = Uri.parse('test:dummy');
|
final Uri dummyUri = Uri.parse('test:dummy');
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -108,6 +118,14 @@ void main() {
|
||||||
_testIfMapEntry();
|
_testIfMapEntry();
|
||||||
_testForMapEntry();
|
_testForMapEntry();
|
||||||
_testForInMapEntry();
|
_testForInMapEntry();
|
||||||
|
_testExpressionMatcher();
|
||||||
|
_testBinaryMatcher();
|
||||||
|
_testCastMatcher();
|
||||||
|
_testNullAssertMatcher();
|
||||||
|
_testNullCheckMatcher();
|
||||||
|
_testListMatcher();
|
||||||
|
_testRelationalMatcher();
|
||||||
|
_testIfCaseStatement();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1037,3 +1055,108 @@ void _testIfMapEntry() {}
|
||||||
void _testForMapEntry() {}
|
void _testForMapEntry() {}
|
||||||
|
|
||||||
void _testForInMapEntry() {}
|
void _testForInMapEntry() {}
|
||||||
|
|
||||||
|
void _testExpressionMatcher() {
|
||||||
|
testMatcher(new ExpressionMatcher(new IntLiteral(0)), '''
|
||||||
|
0''');
|
||||||
|
|
||||||
|
testMatcher(new ExpressionMatcher(new BoolLiteral(true)), '''
|
||||||
|
true''');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _testBinaryMatcher() {
|
||||||
|
testMatcher(
|
||||||
|
new BinaryMatcher(
|
||||||
|
new ExpressionMatcher(new IntLiteral(0)),
|
||||||
|
BinaryMatcherKind.and,
|
||||||
|
new ExpressionMatcher(new IntLiteral(1)),
|
||||||
|
TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
0 & 1''');
|
||||||
|
|
||||||
|
testMatcher(
|
||||||
|
new BinaryMatcher(
|
||||||
|
new ExpressionMatcher(new IntLiteral(0)),
|
||||||
|
BinaryMatcherKind.or,
|
||||||
|
new ExpressionMatcher(new IntLiteral(1)),
|
||||||
|
TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
0 | 1''');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _testCastMatcher() {
|
||||||
|
testMatcher(
|
||||||
|
new CastMatcher(new ExpressionMatcher(new IntLiteral(0)),
|
||||||
|
const DynamicType(), TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
0 as dynamic''');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _testNullAssertMatcher() {
|
||||||
|
testMatcher(
|
||||||
|
new NullAssertMatcher(
|
||||||
|
new ExpressionMatcher(new IntLiteral(0)), TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
0!''');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _testNullCheckMatcher() {
|
||||||
|
testMatcher(
|
||||||
|
new NullCheckMatcher(
|
||||||
|
new ExpressionMatcher(new IntLiteral(0)), TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
0?''');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _testListMatcher() {
|
||||||
|
testMatcher(
|
||||||
|
new ListMatcher(
|
||||||
|
const DynamicType(),
|
||||||
|
[
|
||||||
|
new ExpressionMatcher(new IntLiteral(0)),
|
||||||
|
new ExpressionMatcher(new IntLiteral(1)),
|
||||||
|
],
|
||||||
|
TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
<dynamic>[0, 1]''');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _testRelationalMatcher() {
|
||||||
|
testMatcher(
|
||||||
|
new RelationalMatcher(
|
||||||
|
RelationalMatcherKind.equals, new IntLiteral(0), TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
== 0''');
|
||||||
|
testMatcher(
|
||||||
|
new RelationalMatcher(RelationalMatcherKind.notEquals, new IntLiteral(1),
|
||||||
|
TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
!= 1''');
|
||||||
|
testMatcher(
|
||||||
|
new RelationalMatcher(
|
||||||
|
RelationalMatcherKind.lessThan, new IntLiteral(2), TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
< 2''');
|
||||||
|
}
|
||||||
|
|
||||||
|
void _testIfCaseStatement() {
|
||||||
|
testStatement(
|
||||||
|
new IfCaseStatement(
|
||||||
|
new IntLiteral(0),
|
||||||
|
new ExpressionMatcher(new IntLiteral(1)),
|
||||||
|
new ReturnStatement(),
|
||||||
|
null,
|
||||||
|
TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
if (0 case 1) return;''');
|
||||||
|
|
||||||
|
testStatement(
|
||||||
|
new IfCaseStatement(
|
||||||
|
new IntLiteral(0),
|
||||||
|
new ExpressionMatcher(new IntLiteral(1)),
|
||||||
|
new ReturnStatement(new IntLiteral(2)),
|
||||||
|
new ReturnStatement(new IntLiteral(3)),
|
||||||
|
TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
if (0 case 1) return 2; else return 3;''');
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
library /*isNonNullableByDefault*/;
|
library /*isNonNullableByDefault*/;
|
||||||
import self as self;
|
import self as self;
|
||||||
import "dart:core" as core;
|
|
||||||
|
|
||||||
static method test(dynamic x) → dynamic {
|
static method test(dynamic x) → dynamic {
|
||||||
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
|
;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue