[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:
Johnni Winther 2022-10-21 14:01:02 +00:00 committed by Commit Queue
parent e7c590b137
commit 8995807b2b
91 changed files with 718 additions and 330 deletions

View file

@ -56,6 +56,7 @@ enum NullValue {
IdentifierList,
Initializers,
Labels,
Matcher,
Metadata,
MixinApplicationBuilder,
MatcherList,

View file

@ -674,17 +674,14 @@ class BodyBuilder extends StackListenerImpl
} else if (node is Binder) {
return new BinderMatcher(node);
} else if (node is Generator) {
// TODO(johnniwinther): Generate matcher from Generator.
return new DummyMatcher();
return new ExpressionMatcher(node.buildSimpleRead());
} else if (node is Expression) {
// TODO(johnniwinther): Generate matcher from Expression.
return new DummyMatcher();
return new ExpressionMatcher(node);
} else if (node is ProblemBuilder) {
// ignore: unused_local_variable
Expression expression =
buildProblem(node.message, node.charOffset, noLength);
// TODO(johnniwinther): Generate matcher from Expression.
return new DummyMatcher();
return new ExpressionMatcher(expression);
} else {
return unhandled("${node.runtimeType}", "toMatcher", -1, uri);
}
@ -2280,6 +2277,7 @@ class BodyBuilder extends StackListenerImpl
@override
void handleParenthesizedCondition(Token token, Token? case_, Token? when) {
debugEvent("ParenthesizedCondition");
if (case_ != null) {
// ignore: unused_local_variable
Expression? guard;
@ -2317,20 +2315,22 @@ class BodyBuilder extends StackListenerImpl
]));
reportIfNotEnabled(
libraryFeatures.patterns, case_.charOffset, case_.charCount);
// ignore: unused_local_variable
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, [
unionOfKinds([
ValueKinds.Expression,
ValueKinds.Generator,
ValueKinds.ProblemBuilder,
]),
ValueKinds.Condition,
]));
debugEvent("ParenthesizedCondition");
push(popForValue());
assert(checkState(token, [ValueKinds.Expression]));
}
@override
@ -2667,7 +2667,24 @@ class BodyBuilder extends StackListenerImpl
// ignore: unused_local_variable
Matcher right = toMatcher(pop());
// 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) {
@ -3446,11 +3463,9 @@ class BodyBuilder extends StackListenerImpl
@override
void beginThenStatement(Token token) {
debugEvent("beginThenStatement");
Expression condition = popForValue();
// This is matched by the call to [deferNode] in
// [endThenStatement].
typeInferrer.assignedVariables.beginNode();
push(condition);
enterLocalScope("then");
}
@ -3468,13 +3483,27 @@ class BodyBuilder extends StackListenerImpl
@override
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);
AssignedVariablesNodeInfo assignedVariablesInfo =
pop() as AssignedVariablesNodeInfo;
Statement thenPart = popStatement();
Expression condition = pop() as Expression;
Statement node = forest.createIfStatement(
offsetForToken(ifToken), condition, thenPart, elsePart);
Condition condition = pop() as Condition;
Matcher? matcher = condition.matcher;
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
// [endThenStatement].
typeInferrer.assignedVariables.storeInfo(node, assignedVariablesInfo);
@ -4132,14 +4161,32 @@ class BodyBuilder extends StackListenerImpl
reportIfNotEnabled(libraryFeatures.patterns, leftBracket.charOffset,
leftBracket.charCount);
for (int i = 0; i < count; i++) {
// ignore: unused_local_variable
Matcher element = toMatcher(pop());
List<Matcher> matchers =
new List<Matcher>.filled(count, dummyMatcher, growable: true);
for (int i = count - 1; i >= 0; i--) {
matchers[i] = toMatcher(pop());
}
// ignore: unused_local_variable
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
// TODO(johnniwinther): Create list matcher.
push(new DummyMatcher());
DartType typeArgument;
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
@ -4231,7 +4278,7 @@ class BodyBuilder extends StackListenerImpl
List<Object?>? elements =
const FixedNullableList<Object>().pop(stack, count);
// TODO(johnniwinther): Create a record matcher.
push(new DummyMatcher());
push(new DummyMatcher(token.charOffset));
}
void buildLiteralSet(List<TypeBuilder>? typeArguments, Token? constKeyword,
@ -4381,7 +4428,7 @@ class BodyBuilder extends StackListenerImpl
// ignore: unused_local_variable
Matcher value = toMatcher(pop());
// TODO(johnniwinther): Create map entry.
push(new DummyMatcher());
push(new DummyMatcher(colon.charOffset));
}
@override
@ -4410,7 +4457,7 @@ class BodyBuilder extends StackListenerImpl
}
// ignore: unused_local_variable
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
push(new DummyMatcher());
push(new DummyMatcher(leftBrace.charOffset));
}
@override
@ -4807,13 +4854,10 @@ class BodyBuilder extends StackListenerImpl
]));
reportIfNotEnabled(
libraryFeatures.patterns, operator.charOffset, operator.charCount);
// ignore: unused_local_variable
DartType type = buildDartType(pop() as TypeBuilder, TypeUse.asType,
allowPotentiallyConstantType: libraryBuilder.isNonNullableByDefault);
// ignore: unused_local_variable
Matcher operand = toMatcher(pop());
// TODO(johnniwinther): Create a cast matcher.
push(new DummyMatcher());
push(new CastMatcher(operand, type, operator.charOffset));
}
@override
@ -6190,12 +6234,10 @@ class BodyBuilder extends StackListenerImpl
@override
void handleThenControlFlow(Token token) {
Expression condition = popForValue();
// This is matched by the call to [deferNode] in
// [handleElseControlFlow] and by the call to [endNode] in
// [endIfControlFlow].
typeInferrer.assignedVariables.beginNode();
push(condition);
super.handleThenControlFlow(token);
}
@ -6215,18 +6257,31 @@ class BodyBuilder extends StackListenerImpl
@override
void endIfControlFlow(Token token) {
debugEvent("endIfControlFlow");
assert(checkState(token, [
unionOfKinds([
ValueKinds.Expression,
ValueKinds.Generator,
ValueKinds.ProblemBuilder,
ValueKinds.MapLiteralEntry,
]),
ValueKinds.Condition,
ValueKinds.Token,
]));
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;
transformCollections = true;
TreeNode node;
if (entry is MapLiteralEntry) {
node = forest.createIfMapEntry(
offsetForToken(ifToken), toValue(condition), entry);
offsetForToken(ifToken), condition.expression, entry);
} else {
node = forest.createIfElement(
offsetForToken(ifToken), toValue(condition), toValue(entry));
offsetForToken(ifToken), condition.expression, toValue(entry));
}
push(node);
// This is matched by the call to [beginNode] in
@ -6237,25 +6292,45 @@ class BodyBuilder extends StackListenerImpl
@override
void endIfElseControlFlow(Token token) {
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? thenEntry = pop(); // then entry
AssignedVariablesNodeInfo assignedVariablesInfo =
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;
transformCollections = true;
TreeNode node;
if (thenEntry is MapLiteralEntry) {
if (elseEntry is MapLiteralEntry) {
node = forest.createIfMapEntry(
offsetForToken(ifToken), toValue(condition), thenEntry, elseEntry);
node = forest.createIfMapEntry(offsetForToken(ifToken),
condition.expression, thenEntry, elseEntry);
} else if (elseEntry is ControlFlowElement) {
MapLiteralEntry? elseMapEntry = elseEntry
.toMapLiteralEntry(typeInferrer.assignedVariables.reassignInfo);
if (elseMapEntry != null) {
node = forest.createIfMapEntry(offsetForToken(ifToken),
toValue(condition), thenEntry, elseMapEntry);
condition.expression, thenEntry, elseMapEntry);
} else {
int offset = elseEntry.fileOffset;
node = new MapLiteralEntry(
@ -6280,7 +6355,7 @@ class BodyBuilder extends StackListenerImpl
.toMapLiteralEntry(typeInferrer.assignedVariables.reassignInfo);
if (thenMapEntry != null) {
node = forest.createIfMapEntry(offsetForToken(ifToken),
toValue(condition), thenMapEntry, elseEntry);
condition.expression, thenMapEntry, elseEntry);
} else {
int offset = thenEntry.fileOffset;
node = new MapLiteralEntry(
@ -6300,8 +6375,8 @@ class BodyBuilder extends StackListenerImpl
..fileOffset = offsetForToken(ifToken);
}
} else {
node = forest.createIfElement(offsetForToken(ifToken), toValue(condition),
toValue(thenEntry), toValue(elseEntry));
node = forest.createIfElement(offsetForToken(ifToken),
condition.expression, toValue(thenEntry), toValue(elseEntry));
}
push(node);
// This is matched by the call to [deferNode] in
@ -6641,7 +6716,16 @@ class BodyBuilder extends StackListenerImpl
void endDoWhileStatement(
Token doKeyword, Token whileKeyword, Token endToken) {
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();
JumpTarget continueTarget = exitContinueTarget()!;
JumpTarget breakTarget = exitBreakTarget()!;
@ -6653,7 +6737,7 @@ class BodyBuilder extends StackListenerImpl
body = labeledStatement;
}
Statement doStatement =
forest.createDoStatement(offsetForToken(doKeyword), body, condition);
forest.createDoStatement(offsetForToken(doKeyword), body, expression);
// This is matched by the [beginNode] call in [beginDoWhileStatement].
typeInferrer.assignedVariables.endNode(doStatement);
if (continueStatements != null) {
@ -6971,8 +7055,17 @@ class BodyBuilder extends StackListenerImpl
@override
void endWhileStatement(Token whileKeyword, Token endToken) {
debugEvent("WhileStatement");
assert(checkState(whileKeyword, [
/* body = */ ValueKinds.Statement,
/* condition = */ ValueKinds.Condition,
/* continue target = */ ValueKinds.ContinueTarget,
/* break target = */ ValueKinds.BreakTarget,
]));
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 breakTarget = exitBreakTarget()!;
List<BreakStatementImpl>? continueStatements;
@ -6983,7 +7076,7 @@ class BodyBuilder extends StackListenerImpl
body = labeledStatement;
}
Statement whileStatement = forest.createWhileStatement(
offsetForToken(whileKeyword), condition, body);
offsetForToken(whileKeyword), expression, body);
if (continueStatements != null) {
for (BreakStatementImpl continueStatement in continueStatements) {
continueStatement.targetStatement = whileStatement;
@ -7179,12 +7272,21 @@ class BodyBuilder extends StackListenerImpl
@override
void endSwitchStatement(Token switchKeyword, Token endToken) {
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>;
JumpTarget target = exitBreakTarget()!;
exitSwitchScope();
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)
..fileOffset = switchKeyword.charOffset;
Statement result = switchStatement;
@ -8113,7 +8215,7 @@ class BodyBuilder extends StackListenerImpl
List<TypeBuilder>? typeArguments = pop() as List<TypeBuilder>?;
// TODO(johnniwinther): Create extractor pattern.
push(new DummyMatcher());
push(new DummyMatcher(firstIdentifier.charOffset));
}
@override
@ -8130,10 +8232,36 @@ class BodyBuilder extends StackListenerImpl
]));
reportIfNotEnabled(
libraryFeatures.patterns, token.charOffset, token.charCount);
// ignore: unused_local_variable
Matcher operand = toMatcher(pop());
// TODO(johnniwinther): Create a relational matcher.
push(new DummyMatcher());
Expression operand = toValue(pop());
RelationalMatcherKind kind;
String operator = token.lexeme;
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
@ -8150,10 +8278,8 @@ class BodyBuilder extends StackListenerImpl
]));
reportIfNotEnabled(
libraryFeatures.patterns, bang.charOffset, bang.charCount);
// ignore: unused_local_variable
Matcher operand = toMatcher(pop());
// TODO(johnniwinther): Create a relational matcher.
push(new DummyMatcher());
push(new NullAssertMatcher(operand, bang.charOffset));
}
@override
@ -8172,8 +8298,7 @@ class BodyBuilder extends StackListenerImpl
libraryFeatures.patterns, question.charOffset, question.charCount);
// ignore: unused_local_variable
Matcher operand = toMatcher(pop());
// TODO(johnniwinther): Create a relational matcher.
push(new DummyMatcher());
push(new NullCheckMatcher(operand, question.charOffset));
}
@override
@ -8205,23 +8330,30 @@ class BodyBuilder extends StackListenerImpl
if (colon != null) ValueKinds.IdentifierOrNull,
]));
// ignore: unused_local_variable
Object? value = pop();
if (value is 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 {
// TODO(johnniwinther): Create (named) matcher.
// ignore: unused_local_variable
Matcher matcher = toMatcher(value);
}
// ignore: unused_local_variable
Identifier? name;
if (colon != null) {
name = pop() as Identifier?;
// TODO(johnniwinther): Push named binder/matcher.
push(new DummyMatcher());
} else {
// TODO(johnniwinther): Push binder/matcher.
push(new DummyMatcher());
if (colon != null) {
// ignore: unused_local_variable
Identifier? name = pop() as Identifier?;
// TODO(johnniwinther): Push named binder.
push(new DummyMatcher(colon.charOffset));
} else {
push(matcher);
}
}
}
}
@ -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' : ''})';
}

View file

@ -5011,8 +5011,16 @@ class InternalRecordLiteral extends InternalExpression {
}
abstract class Matcher extends TreeNode {
Matcher(int fileOffset) {
this.fileOffset = fileOffset;
}
@override
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(
"${runtimeType}.accept on ${visitor.runtimeType}", -1, null);
}
@ -5042,6 +5050,8 @@ abstract class Matcher extends TreeNode {
}
class DummyMatcher extends Matcher {
DummyMatcher(int fileOffset) : super(fileOffset);
@override
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 {
final Binder binder;
BinderMatcher(this.binder);
BinderMatcher(this.binder) : super(binder.fileOffset);
@override
void toTextInternal(AstPrinter printer) {
@ -5247,3 +5458,62 @@ class PatternVariableDeclaration extends Statement {
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()})";
}
}

View file

@ -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
show Token;
import 'package:_fe_analyzer_shared/src/type_inference/assigned_variables.dart'
as type;
import 'package:kernel/ast.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 '../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/internal_ast.dart' as type;
@ -45,14 +49,21 @@ class ValueKinds {
static const ValueKind Arguments = const SingleValueKind<type.Arguments>();
static const ValueKind ArgumentsOrNull =
const SingleValueKind<type.Arguments>(NullValue.Arguments);
static const ValueKind AssignedVariablesNodeInfo =
const SingleValueKind<type.AssignedVariablesNodeInfo>();
static const ValueKind AsyncMarker =
const SingleValueKind<type.AsyncMarker>();
static const ValueKind AsyncModifier =
const SingleValueKind<type.AsyncMarker>();
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 Condition = const SingleValueKind<type.Condition>();
static const ValueKind 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 ExpressionOrNull =
const SingleValueKind<type.Expression>(NullValue.Expression);
@ -75,6 +86,8 @@ class ValueKinds {
static const ValueKind MapLiteralEntry =
const SingleValueKind<type.MapLiteralEntry>();
static const ValueKind Matcher = const SingleValueKind<type.Matcher>();
static const ValueKind MatcherOrNull =
const SingleValueKind<type.Matcher>(NullValue.Matcher);
static const ValueKind MatcherListOrNull =
const SingleValueKind<List<type.Matcher>>(NullValue.MatcherList);
static const ValueKind MethodBody = const SingleValueKind<type.MethodBody>();
@ -125,6 +138,8 @@ class ValueKinds {
NullValue.RecordTypeFieldList);
static const ValueKind Scope = const SingleValueKind<type.Scope>();
static const ValueKind Selector = const SingleValueKind<type.Selector>();
static const ValueKind SwitchCaseList =
const SingleValueKind<List<type.SwitchCase>>();
static const ValueKind SwitchScopeOrNull =
const SingleValueKind<type.Scope>(NullValue.SwitchScope);
static const ValueKind Statement = const SingleValueKind<type.Statement>();

View file

@ -1801,6 +1801,12 @@ class InferenceVisitorImpl extends InferenceVisitorBase
return const StatementInferenceResult();
}
StatementInferenceResult visitIfCaseStatement(IfCaseStatement node) {
// TODO(cstefantsova): Handle if-case statements.
return new StatementInferenceResult.single(
new EmptyStatement()..fileOffset = node.fileOffset);
}
ExpressionInferenceResult visitIntJudgment(
IntJudgment node, DartType typeContext) {
if (isDoubleContext(typeContext)) {

View file

@ -42,6 +42,16 @@ void testExpression(Expression node, String normal,
"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');
void main() {
@ -108,6 +118,14 @@ void main() {
_testIfMapEntry();
_testForMapEntry();
_testForInMapEntry();
_testExpressionMatcher();
_testBinaryMatcher();
_testCastMatcher();
_testNullAssertMatcher();
_testNullCheckMatcher();
_testListMatcher();
_testRelationalMatcher();
_testIfCaseStatement();
});
}
@ -1037,3 +1055,108 @@ void _testIfMapEntry() {}
void _testForMapEntry() {}
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;''');
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}

View file

@ -1,8 +1,6 @@
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static method test(dynamic x) → dynamic {
if(x as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool) {
}
;
}