Version 2.12.0-137.0.dev
Merge commit 'a7ee05f27d2264a92e8cbefd504c4af5da91e3f2' into 'dev'
diff --git a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
index 9752d91..7610ce4 100644
--- a/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/flow_analysis/flow_analysis.dart
@@ -2566,8 +2566,12 @@
/// The type of the expression on the LHS of `==` or `!=`.
final Type _leftOperandType;
- _EqualityOpContext(
- ExpressionInfo<Variable, Type> conditionInfo, this._leftOperandType)
+ /// If the LHS of `==` or `!=` is a variable reference, the variable.
+ /// Otherwise `null`.
+ final Variable _leftOperandVariable;
+
+ _EqualityOpContext(ExpressionInfo<Variable, Type> conditionInfo,
+ this._leftOperandType, this._leftOperandVariable)
: super(conditionInfo);
@override
@@ -2602,6 +2606,14 @@
/// corresponding to it. Otherwise `null`.
ExpressionInfo<Variable, Type> _expressionInfo;
+ /// The most recently visited expression which was a variable reference, or
+ /// `null` if no expression has been visited that was a variable reference.
+ Expression _expressionWithVariable;
+
+ /// If [_expressionVariable] is not `null`, the variable corresponding to it.
+ /// Otherwise `null`.
+ Variable _expressionVariable;
+
int _functionNestingLevel = 0;
final AssignedVariables<Node, Variable> _assignedVariables;
@@ -2615,14 +2627,8 @@
@override
void asExpression_end(Expression subExpression, Type type) {
- ExpressionInfo<Variable, Type> subExpressionInfo =
- _getExpressionInfo(subExpression);
- Variable variable;
- if (subExpressionInfo is _VariableReadInfo<Variable, Type>) {
- variable = subExpressionInfo._variable;
- } else {
- return;
- }
+ Variable variable = _getExpressionVariable(subExpression);
+ if (variable == null) return;
_current = _current.tryPromoteForTypeCast(typeOperations, variable, type);
}
@@ -2730,8 +2736,10 @@
_EqualityOpContext<Variable, Type> context =
_stack.removeLast() as _EqualityOpContext<Variable, Type>;
ExpressionInfo<Variable, Type> lhsInfo = context._conditionInfo;
+ Variable lhsVariable = context._leftOperandVariable;
Type leftOperandType = context._leftOperandType;
ExpressionInfo<Variable, Type> rhsInfo = _getExpressionInfo(rightOperand);
+ Variable rhsVariable = _getExpressionVariable(rightOperand);
TypeClassification leftOperandTypeClassification =
typeOperations.classifyType(leftOperandType);
TypeClassification rightOperandTypeClassification =
@@ -2749,18 +2757,16 @@
// but weak mode it might produce an "equal" result. We don't want flow
// analysis behavior to depend on mode, so we conservatively assume that
// either result is possible.
- } else if (lhsInfo is _NullInfo<Variable, Type> &&
- rhsInfo is _VariableReadInfo<Variable, Type>) {
+ } else if (lhsInfo is _NullInfo<Variable, Type> && rhsVariable != null) {
assert(
leftOperandTypeClassification == TypeClassification.nullOrEquivalent);
ExpressionInfo<Variable, Type> equalityInfo =
- _current.tryMarkNonNullable(typeOperations, rhsInfo._variable);
+ _current.tryMarkNonNullable(typeOperations, rhsVariable);
_storeExpressionInfo(wholeExpression,
notEqual ? equalityInfo : ExpressionInfo.invert(equalityInfo));
- } else if (rhsInfo is _NullInfo<Variable, Type> &&
- lhsInfo is _VariableReadInfo<Variable, Type>) {
+ } else if (rhsInfo is _NullInfo<Variable, Type> && lhsVariable != null) {
ExpressionInfo<Variable, Type> equalityInfo =
- _current.tryMarkNonNullable(typeOperations, lhsInfo._variable);
+ _current.tryMarkNonNullable(typeOperations, lhsVariable);
_storeExpressionInfo(wholeExpression,
notEqual ? equalityInfo : ExpressionInfo.invert(equalityInfo));
}
@@ -2769,7 +2775,9 @@
@override
void equalityOp_rightBegin(Expression leftOperand, Type leftOperandType) {
_stack.add(new _EqualityOpContext<Variable, Type>(
- _getExpressionInfo(leftOperand), leftOperandType));
+ _getExpressionInfo(leftOperand),
+ leftOperandType,
+ _getExpressionVariable(leftOperand)));
}
@override
@@ -2844,6 +2852,9 @@
if (identical(_expressionWithInfo, oldExpression)) {
_expressionWithInfo = newExpression;
}
+ if (identical(_expressionWithVariable, oldExpression)) {
+ _expressionWithVariable = newExpression;
+ }
}
@override
@@ -2901,12 +2912,12 @@
@override
void ifNullExpression_rightBegin(
Expression leftHandSide, Type leftHandSideType) {
- ExpressionInfo<Variable, Type> lhsInfo = _getExpressionInfo(leftHandSide);
+ Variable lhsVariable = _getExpressionVariable(leftHandSide);
FlowModel<Variable, Type> promoted;
_current = _current.split();
- if (lhsInfo is _VariableReadInfo<Variable, Type>) {
+ if (lhsVariable != null) {
ExpressionInfo<Variable, Type> promotionInfo =
- _current.tryMarkNonNullable(typeOperations, lhsInfo._variable);
+ _current.tryMarkNonNullable(typeOperations, lhsVariable);
_current = promotionInfo.ifFalse;
promoted = promotionInfo.ifTrue;
} else {
@@ -2959,12 +2970,10 @@
@override
void isExpression_end(Expression isExpression, Expression subExpression,
bool isNot, Type type) {
- ExpressionInfo<Variable, Type> subExpressionInfo =
- _getExpressionInfo(subExpression);
- if (subExpressionInfo is _VariableReadInfo<Variable, Type>) {
- ExpressionInfo<Variable, Type> expressionInfo =
- _current.tryPromoteForTypeCheck(
- typeOperations, subExpressionInfo._variable, type);
+ Variable subExpressionVariable = _getExpressionVariable(subExpression);
+ if (subExpressionVariable != null) {
+ ExpressionInfo<Variable, Type> expressionInfo = _current
+ .tryPromoteForTypeCheck(typeOperations, subExpressionVariable, type);
_storeExpressionInfo(isExpression,
isNot ? ExpressionInfo.invert(expressionInfo) : expressionInfo);
}
@@ -3054,11 +3063,10 @@
@override
void nonNullAssert_end(Expression operand) {
- ExpressionInfo<Variable, Type> operandInfo = _getExpressionInfo(operand);
- if (operandInfo is _VariableReadInfo<Variable, Type>) {
- _current = _current
- .tryMarkNonNullable(typeOperations, operandInfo._variable)
- .ifTrue;
+ Variable operandVariable = _getExpressionVariable(operand);
+ if (operandVariable != null) {
+ _current =
+ _current.tryMarkNonNullable(typeOperations, operandVariable).ifTrue;
}
}
@@ -3075,11 +3083,10 @@
_current = _current.split();
_stack.add(new _NullAwareAccessContext<Variable, Type>(_current));
if (target != null) {
- ExpressionInfo<Variable, Type> targetInfo = _getExpressionInfo(target);
- if (targetInfo is _VariableReadInfo<Variable, Type>) {
- _current = _current
- .tryMarkNonNullable(typeOperations, targetInfo._variable)
- .ifTrue;
+ Variable targetVariable = _getExpressionVariable(target);
+ if (targetVariable != null) {
+ _current =
+ _current.tryMarkNonNullable(typeOperations, targetVariable).ifTrue;
}
}
}
@@ -3226,7 +3233,7 @@
@override
Type variableRead(Expression expression, Variable variable) {
- _storeExpressionInfo(expression, new _VariableReadInfo(_current, variable));
+ _storeExpressionVariable(expression, variable);
return _current.infoFor(variable).promotedTypes?.last;
}
@@ -3273,6 +3280,8 @@
print(' current: $_current');
print(' expressionWithInfo: $_expressionWithInfo');
print(' expressionInfo: $_expressionInfo');
+ print(' expressionWithVariable: $_expressionWithVariable');
+ print(' expressionVariable: $_expressionVariable');
print(' stack:');
for (_FlowContext stackEntry in _stack.reversed) {
print(' $stackEntry');
@@ -3301,6 +3310,19 @@
}
}
+ /// Gets the [Variable] associated with the [expression] (which should be the
+ /// last expression that was traversed). If there is no [Variable] associated
+ /// with the [expression], then `null` is returned.
+ Variable _getExpressionVariable(Expression expression) {
+ if (identical(expression, _expressionWithVariable)) {
+ Variable expressionVariable = _expressionVariable;
+ _expressionVariable = null;
+ return expressionVariable;
+ } else {
+ return null;
+ }
+ }
+
FlowModel<Variable, Type> _join(
FlowModel<Variable, Type> first, FlowModel<Variable, Type> second) =>
FlowModel.join(typeOperations, first, second, _current._emptyVariableMap);
@@ -3319,6 +3341,14 @@
_expressionInfo = expressionInfo;
_current = expressionInfo.after;
}
+
+ /// Associates [expression], which should be the most recently visited
+ /// expression, with the given [Variable] object.
+ void _storeExpressionVariable(
+ Expression expression, Variable expressionVariable) {
+ _expressionWithVariable = expression;
+ _expressionVariable = expressionVariable;
+ }
}
/// Base class for objects representing constructs in the Dart programming
@@ -3437,28 +3467,6 @@
'afterBodyAndCatches: $_afterBodyAndCatches)';
}
-/// [ExpressionInfo] representing an expression that reads the value of a
-/// variable.
-class _VariableReadInfo<Variable, Type>
- implements ExpressionInfo<Variable, Type> {
- @override
- final FlowModel<Variable, Type> after;
-
- /// The variable that is being read.
- final Variable _variable;
-
- _VariableReadInfo(this.after, this._variable);
-
- @override
- FlowModel<Variable, Type> get ifFalse => after;
-
- @override
- FlowModel<Variable, Type> get ifTrue => after;
-
- @override
- String toString() => '_VariableReadInfo(after: $after, variable: $_variable)';
-}
-
/// [_FlowContext] representing a `while` loop (or a C-style `for` loop, which
/// is functionally similar).
class _WhileContext<Variable, Type>
diff --git a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
index e40a4fc..8604cfc 100644
--- a/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
@@ -9451,6 +9451,31 @@
tip: r"""Try adding a backslash (\) to escape the '$'.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(
+ Token
+ token)> templateUnexpectedModifierInNonNnbd = const Template<
+ Message Function(Token token)>(
+ messageTemplate:
+ r"""The modifier '#lexeme' is only available in null safe libraries.""",
+ withArguments: _withArgumentsUnexpectedModifierInNonNnbd);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(Token token)> codeUnexpectedModifierInNonNnbd =
+ const Code<Message Function(Token token)>(
+ "UnexpectedModifierInNonNnbd", templateUnexpectedModifierInNonNnbd,
+ analyzerCodes: <String>["UNEXPECTED_TOKEN"]);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsUnexpectedModifierInNonNnbd(Token token) {
+ String lexeme = token.lexeme;
+ return new Message(codeUnexpectedModifierInNonNnbd,
+ message:
+ """The modifier '${lexeme}' is only available in null safe libraries.""",
+ arguments: {'token': token});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(Token token)> templateUnexpectedToken =
const Template<Message Function(Token token)>(
messageTemplate: r"""Unexpected token '#lexeme'.""",
diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
index 6b2b389..5754bf3 100644
--- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
+++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart
@@ -20,6 +20,7 @@
POSTFIX_PRECEDENCE,
RELATIONAL_PRECEDENCE,
SELECTOR_PRECEDENCE,
+ StringToken,
SyntheticBeginToken,
SyntheticKeywordToken,
SyntheticStringToken,
@@ -1394,6 +1395,42 @@
return codes.messageMissingFunctionParameters;
}
+ /// Check if [token] is the usage of 'required' in a formal parameter in a
+ /// context where it's not legal (i.e. in non-nnbd-mode).
+ bool _isUseOfRequiredInNonNNBD(Token token) {
+ if (token.next is StringToken && token.next.value() == "required") {
+ // Possible recovery: Figure out if we're in a situation like
+ // required covariant? <type> name
+ // (in non-nnbd-mode) where the required modifier is not legal and thus
+ // would normally be parsed as the type.
+ token = token.next;
+ Token next = token.next;
+ // Skip modifiers.
+ while (next.isModifier) {
+ token = next;
+ next = next.next;
+ }
+ // Parse the (potential) new type.
+ TypeInfo typeInfoAlternative = computeType(
+ token,
+ /* required = */ false,
+ /* inDeclaration = */ true);
+ token = typeInfoAlternative.skipType(token);
+ next = token.next;
+
+ // We've essentially ignored the 'required' at this point.
+ // `token` is (in the good state) the last token of the type,
+ // `next` is (in the good state) the name;
+ // Are we in a 'good' state?
+ if (typeInfoAlternative != noType &&
+ next.isIdentifier &&
+ (optional(',', next.next) || optional('}', next.next))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/// ```
/// normalFormalParameter:
/// functionFormalParameter |
@@ -1417,6 +1454,15 @@
Token token, FormalParameterKind parameterKind, MemberKind memberKind) {
assert(parameterKind != null);
token = parseMetadataStar(token);
+
+ Token skippedNonRequiredRequired;
+ if (_isUseOfRequiredInNonNNBD(token)) {
+ skippedNonRequiredRequired = token.next;
+ reportRecoverableErrorWithToken(skippedNonRequiredRequired,
+ codes.templateUnexpectedModifierInNonNnbd);
+ token = token.next;
+ }
+
Token next = token.next;
Token start = next;
@@ -1477,6 +1523,13 @@
}
}
+ if (requiredToken == null) {
+ // `required` was used as a modifier in non-nnbd mode. An error has been
+ // emitted. Still use it as a required token for the remainder in an
+ // attempt to avoid cascading errors (and for passing to the listener).
+ requiredToken = skippedNonRequiredRequired;
+ }
+
listener.beginFormalParameter(
start, memberKind, requiredToken, covariantToken, varFinalOrConst);
@@ -2363,11 +2416,57 @@
return parseTopLevelMemberImpl(token).next;
}
+ /// Check if [token] is the usage of 'late' before a field declaration in a
+ /// context where it's not legal (i.e. in non-nnbd-mode).
+ bool _isUseOfLateInNonNNBD(Token token) {
+ if (token is StringToken && token.value() == "late") {
+ // Possible recovery: Figure out if we're in a situation like
+ // late final? <type>/var/const name [...]
+ // (in non-nnbd-mode) where the late modifier is not legal and thus would
+ // normally be parsed as the type.
+ Token next = token.next;
+ // Skip modifiers.
+ while (next.isModifier) {
+ token = next;
+ next = next.next;
+ }
+ // Parse the (potential) new type.
+ TypeInfo typeInfoAlternative = computeType(
+ token,
+ /* required = */ false,
+ /* inDeclaration = */ true);
+ token = typeInfoAlternative.skipType(token);
+ next = token.next;
+
+ // We've essentially ignored the 'late' at this point.
+ // `token` is (in the good state) the last token of the type,
+ // `next` is (in the good state) the name;
+ // Are we in a 'good' state?
+ if (typeInfoAlternative != noType &&
+ next.isIdentifier &&
+ indicatesMethodOrField(next.next)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
Token parseTopLevelMemberImpl(Token token) {
Token beforeStart = token;
Token next = token.next;
listener.beginTopLevelMember(next);
+ Token skippedNonLateLate;
+
+ if (_isUseOfLateInNonNNBD(next)) {
+ skippedNonLateLate = next;
+ reportRecoverableErrorWithToken(
+ skippedNonLateLate, codes.templateUnexpectedModifierInNonNnbd);
+ token = token.next;
+ beforeStart = token;
+ next = token.next;
+ }
+
Token externalToken;
Token lateToken;
Token varFinalOrConst;
@@ -2421,6 +2520,12 @@
}
}
}
+ if (lateToken == null) {
+ // `late` was used as a modifier in non-nnbd mode. An error has been
+ // emitted. Still use it as a late token for the remainder in an attempt
+ // to avoid cascading errors (and for passing to the listener).
+ lateToken = skippedNonLateLate;
+ }
Token beforeType = token;
TypeInfo typeInfo =
@@ -3307,6 +3412,16 @@
Token token, DeclarationKind kind, String enclosingDeclarationName) {
Token beforeStart = token = parseMetadataStar(token);
+ Token skippedNonLateLate;
+
+ if (_isUseOfLateInNonNNBD(token.next)) {
+ skippedNonLateLate = token.next;
+ reportRecoverableErrorWithToken(
+ skippedNonLateLate, codes.templateUnexpectedModifierInNonNnbd);
+ token = token.next;
+ beforeStart = token;
+ }
+
Token covariantToken;
Token abstractToken;
Token externalToken;
@@ -3374,6 +3489,13 @@
}
}
+ if (lateToken == null) {
+ // `late` was used as a modifier in non-nnbd mode. An error has been
+ // emitted. Still use it as a late token for the remainder in an attempt
+ // to avoid cascading errors (and for passing to the listener).
+ lateToken = skippedNonLateLate;
+ }
+
listener.beginMember();
Token beforeType = token;
@@ -6079,12 +6201,30 @@
/// See [parseExpressionStatementOrDeclaration]
Token parseExpressionStatementOrDeclarationAfterModifiers(
- final Token beforeType,
- final Token start,
- final Token lateToken,
+ Token beforeType,
+ Token start,
+ Token lateToken,
Token varFinalOrConst,
TypeInfo typeInfo,
bool onlyParseVariableDeclarationStart) {
+ // In simple cases check for bad 'late' modifier in non-nnbd-mode.
+ if (typeInfo == null &&
+ lateToken == null &&
+ varFinalOrConst == null &&
+ beforeType == start &&
+ _isUseOfLateInNonNNBD(beforeType.next)) {
+ lateToken = beforeType.next;
+ reportRecoverableErrorWithToken(
+ lateToken, codes.templateUnexpectedModifierInNonNnbd);
+ beforeType = start = beforeType.next;
+
+ // The below doesn't parse modifiers, so we need to do it here.
+ ModifierRecoveryContext context = new ModifierRecoveryContext(this);
+ beforeType =
+ start = context.parseVariableDeclarationModifiers(beforeType);
+ varFinalOrConst = context.varFinalOrConst;
+ context = null;
+ }
typeInfo ??= computeType(beforeType, /* required = */ false);
Token token = typeInfo.skipType(beforeType);
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index 96f20a7..536e431 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -4906,3 +4906,10 @@
ExportedMain:
template: "This is exported 'main' declaration."
severity: CONTEXT
+
+UnexpectedModifierInNonNnbd:
+ template: "The modifier '#lexeme' is only available in null safe libraries."
+ exampleAllowMoreCodes: true
+ analyzerCode: UNEXPECTED_TOKEN
+ script:
+ - "late int x;"
\ No newline at end of file
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart
new file mode 100644
index 0000000..e437881
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart
@@ -0,0 +1,32 @@
+// https://github.com/dart-lang/sdk/issues/44379
+
+int x1;
+late int x2;
+late List<int> x3;
+late final int x4;
+late x5;
+; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+late;
+; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+
+main(List<String> args) {
+ int y1;
+ late int y2;
+ late List<int> y3;
+ late final int y4;
+ late y5;
+ ; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+ late;
+ ; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+}
+
+class Foo {
+ int z1;
+ late int z2;
+ late List<int> x3;
+ late final int z4;
+ late z5;
+ ; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+ late;
+ ; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+}
\ No newline at end of file
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.expect b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.expect
new file mode 100644
index 0000000..7abe937
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.expect
@@ -0,0 +1,343 @@
+Problems reported:
+
+parser/non-nnbd/use_late_in_non_nnbd:4:1: The modifier 'late' is only available in null safe libraries.
+late int x2;
+^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:5:1: The modifier 'late' is only available in null safe libraries.
+late List<int> x3;
+^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:6:1: The modifier 'late' is only available in null safe libraries.
+late final int x4;
+^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:8:1: Unexpected token ';'.
+; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+^
+
+parser/non-nnbd/use_late_in_non_nnbd:9:1: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
+late;
+^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:10:1: Unexpected token ';'.
+; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+^
+
+parser/non-nnbd/use_late_in_non_nnbd:14:3: The modifier 'late' is only available in null safe libraries.
+ late int y2;
+ ^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:15:3: The modifier 'late' is only available in null safe libraries.
+ late List<int> y3;
+ ^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:16:3: The modifier 'late' is only available in null safe libraries.
+ late final int y4;
+ ^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:25:3: The modifier 'late' is only available in null safe libraries.
+ late int z2;
+ ^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:26:3: The modifier 'late' is only available in null safe libraries.
+ late List<int> x3;
+ ^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:27:3: The modifier 'late' is only available in null safe libraries.
+ late final int z4;
+ ^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:29:3: Expected a class member, but got ';'.
+ ; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+ ^
+
+parser/non-nnbd/use_late_in_non_nnbd:30:3: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
+ late;
+ ^^^^
+
+parser/non-nnbd/use_late_in_non_nnbd:31:3: Expected a class member, but got ';'.
+ ; // Meant to confuse so `.next`-ing makes it look like the end of a field.
+ ^
+
+beginCompilationUnit(int)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginTopLevelMember(int)
+ beginFields()
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x1)
+ handleType(int, null)
+ handleIdentifier(x1, topLevelVariableDeclaration)
+ handleNoFieldInitializer(;)
+ endTopLevelFields(null, null, null, null, null, 1, int, ;)
+ endTopLevelDeclaration(late)
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ beginTopLevelMember(late)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginFields(late)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x2)
+ handleType(int, null)
+ handleIdentifier(x2, topLevelVariableDeclaration)
+ handleNoFieldInitializer(;)
+ endTopLevelFields(null, null, null, late, null, 1, int, ;)
+ endTopLevelDeclaration(late)
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ beginTopLevelMember(late)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginFields(late)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(>)
+ handleType(int, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ handleIdentifier(x3, topLevelVariableDeclaration)
+ handleNoFieldInitializer(;)
+ endTopLevelFields(null, null, null, late, null, 1, List, ;)
+ endTopLevelDeclaration(late)
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ beginTopLevelMember(late)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginFields(late)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x4)
+ handleType(int, null)
+ handleIdentifier(x4, topLevelVariableDeclaration)
+ handleNoFieldInitializer(;)
+ endTopLevelFields(null, null, null, late, final, 1, final, ;)
+ endTopLevelDeclaration(late)
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ beginTopLevelMember(late)
+ beginFields(;)
+ handleIdentifier(late, typeReference)
+ handleNoTypeArguments(x5)
+ handleType(late, null)
+ handleIdentifier(x5, topLevelVariableDeclaration)
+ handleNoFieldInitializer(;)
+ endTopLevelFields(null, null, null, null, null, 1, late, ;)
+ endTopLevelDeclaration(;)
+ beginMetadataStar(;)
+ endMetadataStar(0)
+ beginTopLevelMember(;)
+ handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {token: ;}], ;, ;)
+ handleInvalidTopLevelDeclaration(;)
+ endTopLevelDeclaration(late)
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ beginTopLevelMember(late)
+ beginFields(;)
+ handleRecoverableError(MissingConstFinalVarOrType, late, late)
+ handleNoType(;)
+ handleIdentifier(late, topLevelVariableDeclaration)
+ handleNoFieldInitializer(;)
+ endTopLevelFields(null, null, null, null, null, 1, late, ;)
+ endTopLevelDeclaration(;)
+ beginMetadataStar(;)
+ endMetadataStar(0)
+ beginTopLevelMember(;)
+ handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {token: ;}], ;, ;)
+ handleInvalidTopLevelDeclaration(;)
+ endTopLevelDeclaration(main)
+ beginMetadataStar(main)
+ endMetadataStar(0)
+ beginTopLevelMember(main)
+ beginTopLevelMethod(;, null)
+ handleNoType(;)
+ handleIdentifier(main, topLevelFunctionDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ beginMetadataStar(List)
+ endMetadataStar(0)
+ beginFormalParameter(List, MemberKind.TopLevelMethod, null, null, null)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(String, typeReference)
+ handleNoTypeArguments(>)
+ handleType(String, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ handleIdentifier(args, formalParameterDeclaration)
+ handleFormalParameterWithoutValue())
+ endFormalParameter(null, null, args, null, null, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(y1)
+ handleType(int, null)
+ beginVariablesDeclaration(y1, null, null)
+ handleIdentifier(y1, localVariableDeclaration)
+ beginInitializedIdentifier(y1)
+ handleNoVariableInitializer(y1)
+ endInitializedIdentifier(y1)
+ endVariablesDeclaration(1, ;)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(y2)
+ handleType(int, null)
+ beginVariablesDeclaration(y2, late, null)
+ handleIdentifier(y2, localVariableDeclaration)
+ beginInitializedIdentifier(y2)
+ handleNoVariableInitializer(y2)
+ endInitializedIdentifier(y2)
+ endVariablesDeclaration(1, ;)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginMetadataStar(List)
+ endMetadataStar(0)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(>)
+ handleType(int, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ beginVariablesDeclaration(y3, late, null)
+ handleIdentifier(y3, localVariableDeclaration)
+ beginInitializedIdentifier(y3)
+ handleNoVariableInitializer(y3)
+ endInitializedIdentifier(y3)
+ endVariablesDeclaration(1, ;)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(y4)
+ handleType(int, null)
+ beginVariablesDeclaration(y4, late, final)
+ handleIdentifier(y4, localVariableDeclaration)
+ beginInitializedIdentifier(y4)
+ handleNoVariableInitializer(y4)
+ endInitializedIdentifier(y4)
+ endVariablesDeclaration(1, ;)
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ handleIdentifier(late, typeReference)
+ handleNoTypeArguments(y5)
+ handleType(late, null)
+ beginVariablesDeclaration(y5, null, null)
+ handleIdentifier(y5, localVariableDeclaration)
+ beginInitializedIdentifier(y5)
+ handleNoVariableInitializer(y5)
+ endInitializedIdentifier(y5)
+ endVariablesDeclaration(1, ;)
+ handleEmptyStatement(;)
+ handleIdentifier(late, expression)
+ handleNoTypeArguments(;)
+ handleNoArguments(;)
+ handleSend(late, ;)
+ handleExpressionStatement(;)
+ handleEmptyStatement(;)
+ endBlockFunctionBody(8, {, })
+ endTopLevelMethod(main, null, })
+ endTopLevelDeclaration(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(Foo, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, Foo)
+ handleNoType(Foo)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(int)
+ endMetadataStar(0)
+ beginMember()
+ beginFields({)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(z1)
+ handleType(int, null)
+ handleIdentifier(z1, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, null, null, 1, int, ;)
+ endMember()
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginMember()
+ beginFields(late)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(z2)
+ handleType(int, null)
+ handleIdentifier(z2, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, late, null, 1, int, ;)
+ endMember()
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginMember()
+ beginFields(late)
+ handleIdentifier(List, typeReference)
+ beginTypeArguments(<)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(>)
+ handleType(int, null)
+ endTypeArguments(1, <, >)
+ handleType(List, null)
+ handleIdentifier(x3, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, late, null, 1, List, ;)
+ endMember()
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ beginMember()
+ beginFields(late)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(z4)
+ handleType(int, null)
+ handleIdentifier(z4, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, late, final, 1, final, ;)
+ endMember()
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ beginMember()
+ beginFields(;)
+ handleIdentifier(late, typeReference)
+ handleNoTypeArguments(z5)
+ handleType(late, null)
+ handleIdentifier(z5, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, null, null, 1, late, ;)
+ endMember()
+ beginMetadataStar(;)
+ endMetadataStar(0)
+ beginMember()
+ handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {token: ;}], ;, ;)
+ handleInvalidMember(;)
+ endMember()
+ beginMetadataStar(late)
+ endMetadataStar(0)
+ beginMember()
+ beginFields(;)
+ handleRecoverableError(MissingConstFinalVarOrType, late, late)
+ handleNoType(;)
+ handleIdentifier(late, fieldDeclaration)
+ handleNoFieldInitializer(;)
+ endClassFields(null, null, null, null, null, null, 1, late, ;)
+ endMember()
+ beginMetadataStar(;)
+ endMetadataStar(0)
+ beginMember()
+ handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {token: ;}], ;, ;)
+ handleInvalidMember(;)
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 8, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration()
+endCompilationUnit(10, )
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.intertwined.expect b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.intertwined.expect
new file mode 100644
index 0000000..10e9d5e
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.intertwined.expect
@@ -0,0 +1,500 @@
+parseUnit(int)
+ skipErrorTokens(int)
+ listener: beginCompilationUnit(int)
+ syntheticPreviousToken(int)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl()
+ listener: beginTopLevelMember(int)
+ parseFields(, null, null, null, null, null, null, , Instance of 'SimpleType', x1, DeclarationKind.TopLevel, null, false)
+ listener: beginFields()
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x1)
+ listener: handleType(int, null)
+ ensureIdentifierPotentiallyRecovered(int, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(x1, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(x1, x1, null, null, null, null, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer(;)
+ listener: endTopLevelFields(null, null, null, null, null, 1, int, ;)
+ listener: endTopLevelDeclaration(late)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(late)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ parseFields(late, null, null, null, null, late, null, late, Instance of 'SimpleType', x2, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(late)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x2)
+ listener: handleType(int, null)
+ ensureIdentifierPotentiallyRecovered(int, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(x2, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(x2, x2, late, null, null, null, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer(;)
+ listener: endTopLevelFields(null, null, null, late, null, 1, int, ;)
+ listener: endTopLevelDeclaration(late)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(late)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ parseFields(late, null, null, null, null, late, null, late, Instance of 'SimpleTypeWith1Argument', x3, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(late)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(int, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ ensureIdentifierPotentiallyRecovered(>, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(x3, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(x3, x3, late, null, null, null, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer(;)
+ listener: endTopLevelFields(null, null, null, late, null, 1, List, ;)
+ listener: endTopLevelDeclaration(late)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(late)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ parseFields(late, null, null, null, null, late, final, final, Instance of 'SimpleType', x4, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(late)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x4)
+ listener: handleType(int, null)
+ ensureIdentifierPotentiallyRecovered(int, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(x4, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(x4, x4, late, null, null, final, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer(;)
+ listener: endTopLevelFields(null, null, null, late, final, 1, final, ;)
+ listener: endTopLevelDeclaration(late)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(late)
+ parseFields(;, null, null, null, null, null, null, ;, Instance of 'SimpleType', x5, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ listener: handleIdentifier(late, typeReference)
+ listener: handleNoTypeArguments(x5)
+ listener: handleType(late, null)
+ ensureIdentifierPotentiallyRecovered(late, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(x5, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(x5, x5, null, null, null, null, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer(;)
+ listener: endTopLevelFields(null, null, null, null, null, 1, late, ;)
+ listener: endTopLevelDeclaration(;)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(;)
+ listener: endMetadataStar(0)
+ listener: beginTopLevelMember(;)
+ parseInvalidTopLevelDeclaration(;)
+ reportRecoverableErrorWithToken(;, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {token: ;}], ;, ;)
+ listener: handleInvalidTopLevelDeclaration(;)
+ listener: endTopLevelDeclaration(late)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(late)
+ isReservedKeyword(;)
+ parseFields(;, null, null, null, null, null, null, ;, Instance of 'NoType', late, DeclarationKind.TopLevel, null, false)
+ listener: beginFields(;)
+ reportRecoverableError(late, MissingConstFinalVarOrType)
+ listener: handleRecoverableError(MissingConstFinalVarOrType, late, late)
+ listener: handleNoType(;)
+ ensureIdentifierPotentiallyRecovered(;, topLevelVariableDeclaration, false)
+ listener: handleIdentifier(late, topLevelVariableDeclaration)
+ parseFieldInitializerOpt(late, late, null, null, null, null, DeclarationKind.TopLevel, null)
+ listener: handleNoFieldInitializer(;)
+ listener: endTopLevelFields(null, null, null, null, null, 1, late, ;)
+ listener: endTopLevelDeclaration(;)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(;)
+ listener: endMetadataStar(0)
+ listener: beginTopLevelMember(;)
+ parseInvalidTopLevelDeclaration(;)
+ reportRecoverableErrorWithToken(;, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedToken, Unexpected token ';'., null, {token: ;}], ;, ;)
+ listener: handleInvalidTopLevelDeclaration(;)
+ listener: endTopLevelDeclaration(main)
+ parseTopLevelDeclarationImpl(;, Instance of 'DirectiveContext')
+ parseMetadataStar(;)
+ listener: beginMetadataStar(main)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(;)
+ listener: beginTopLevelMember(main)
+ isReservedKeyword(()
+ parseTopLevelMethod(;, null, ;, Instance of 'NoType', null, main, false)
+ listener: beginTopLevelMethod(;, null)
+ listener: handleNoType(;)
+ ensureIdentifierPotentiallyRecovered(;, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(main, topLevelFunctionDeclaration)
+ parseMethodTypeVar(main)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod)
+ parseFormalParameters(main, MemberKind.TopLevelMethod)
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ parseFormalParameter((, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ parseMetadataStar(()
+ listener: beginMetadataStar(List)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(List, MemberKind.TopLevelMethod, null, null, null)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(String, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(String, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ ensureIdentifier(>, formalParameterDeclaration)
+ listener: handleIdentifier(args, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue())
+ listener: endFormalParameter(null, null, args, null, null, FormalParameterKind.mandatory, MemberKind.TopLevelMethod)
+ listener: endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, int)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(y1)
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(y1)
+ listener: handleType(int, null)
+ listener: beginVariablesDeclaration(y1, null, null)
+ parseVariablesDeclarationRest(int, true)
+ parseOptionallyInitializedIdentifier(int)
+ ensureIdentifier(int, localVariableDeclaration)
+ listener: handleIdentifier(y1, localVariableDeclaration)
+ listener: beginInitializedIdentifier(y1)
+ parseVariableInitializerOpt(y1)
+ listener: handleNoVariableInitializer(y1)
+ listener: endInitializedIdentifier(y1)
+ ensureSemicolon(y1)
+ listener: endVariablesDeclaration(1, ;)
+ notEofOrValue(}, late)
+ parseStatement(;)
+ parseStatementX(;)
+ parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, false)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ looksLikeLocalFunction(y2)
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(y2)
+ listener: handleType(int, null)
+ listener: beginVariablesDeclaration(y2, late, null)
+ parseVariablesDeclarationRest(int, true)
+ parseOptionallyInitializedIdentifier(int)
+ ensureIdentifier(int, localVariableDeclaration)
+ listener: handleIdentifier(y2, localVariableDeclaration)
+ listener: beginInitializedIdentifier(y2)
+ parseVariableInitializerOpt(y2)
+ listener: handleNoVariableInitializer(y2)
+ listener: endInitializedIdentifier(y2)
+ ensureSemicolon(y2)
+ listener: endVariablesDeclaration(1, ;)
+ notEofOrValue(}, late)
+ parseStatement(;)
+ parseStatementX(;)
+ parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, false)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ looksLikeLocalFunction(y3)
+ listener: beginMetadataStar(List)
+ listener: endMetadataStar(0)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(int, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ listener: beginVariablesDeclaration(y3, late, null)
+ parseVariablesDeclarationRest(>, true)
+ parseOptionallyInitializedIdentifier(>)
+ ensureIdentifier(>, localVariableDeclaration)
+ listener: handleIdentifier(y3, localVariableDeclaration)
+ listener: beginInitializedIdentifier(y3)
+ parseVariableInitializerOpt(y3)
+ listener: handleNoVariableInitializer(y3)
+ listener: endInitializedIdentifier(y3)
+ ensureSemicolon(y3)
+ listener: endVariablesDeclaration(1, ;)
+ notEofOrValue(}, late)
+ parseStatement(;)
+ parseStatementX(;)
+ parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, false)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ looksLikeLocalFunction(y4)
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(y4)
+ listener: handleType(int, null)
+ listener: beginVariablesDeclaration(y4, late, final)
+ parseVariablesDeclarationRest(int, true)
+ parseOptionallyInitializedIdentifier(int)
+ ensureIdentifier(int, localVariableDeclaration)
+ listener: handleIdentifier(y4, localVariableDeclaration)
+ listener: beginInitializedIdentifier(y4)
+ parseVariableInitializerOpt(y4)
+ listener: handleNoVariableInitializer(y4)
+ listener: endInitializedIdentifier(y4)
+ ensureSemicolon(y4)
+ listener: endVariablesDeclaration(1, ;)
+ notEofOrValue(}, late)
+ parseStatement(;)
+ parseStatementX(;)
+ parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, false)
+ looksLikeLocalFunction(y5)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ listener: handleIdentifier(late, typeReference)
+ listener: handleNoTypeArguments(y5)
+ listener: handleType(late, null)
+ listener: beginVariablesDeclaration(y5, null, null)
+ parseVariablesDeclarationRest(late, true)
+ parseOptionallyInitializedIdentifier(late)
+ ensureIdentifier(late, localVariableDeclaration)
+ listener: handleIdentifier(y5, localVariableDeclaration)
+ listener: beginInitializedIdentifier(y5)
+ parseVariableInitializerOpt(y5)
+ listener: handleNoVariableInitializer(y5)
+ listener: endInitializedIdentifier(y5)
+ ensureSemicolon(y5)
+ listener: endVariablesDeclaration(1, ;)
+ notEofOrValue(}, ;)
+ parseStatement(;)
+ parseStatementX(;)
+ parseEmptyStatement(;)
+ listener: handleEmptyStatement(;)
+ notEofOrValue(}, late)
+ parseStatement(;)
+ parseStatementX(;)
+ parseExpressionStatementOrDeclarationAfterModifiers(;, ;, null, null, null, false)
+ looksLikeLocalFunction(late)
+ parseExpressionStatement(;)
+ parseExpression(;)
+ parsePrecedenceExpression(;, 1, true)
+ parseUnaryExpression(;, true)
+ parsePrimary(;, expression)
+ parseSendOrFunctionLiteral(;, expression)
+ parseSend(;, expression)
+ ensureIdentifier(;, expression)
+ listener: handleIdentifier(late, expression)
+ listener: handleNoTypeArguments(;)
+ parseArgumentsOpt(late)
+ listener: handleNoArguments(;)
+ listener: handleSend(late, ;)
+ ensureSemicolon(late)
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, ;)
+ parseStatement(;)
+ parseStatementX(;)
+ parseEmptyStatement(;)
+ listener: handleEmptyStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(8, {, })
+ listener: endTopLevelMethod(main, null, })
+ listener: endTopLevelDeclaration(class)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(}, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(}, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(Foo, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, Foo)
+ parseClass(Foo, class, class, Foo)
+ parseClassHeaderOpt(Foo, class, class)
+ parseClassExtendsOpt(Foo)
+ listener: handleNoType(Foo)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(Foo)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(Foo)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, int)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, Foo)
+ parseMetadataStar({)
+ listener: beginMetadataStar(int)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseFields({, null, null, null, null, null, null, {, Instance of 'SimpleType', z1, DeclarationKind.Class, Foo, false)
+ listener: beginFields({)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(z1)
+ listener: handleType(int, null)
+ ensureIdentifierPotentiallyRecovered(int, fieldDeclaration, false)
+ listener: handleIdentifier(z1, fieldDeclaration)
+ parseFieldInitializerOpt(z1, z1, null, null, null, null, DeclarationKind.Class, Foo)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, null, null, 1, int, ;)
+ listener: endMember()
+ notEofOrValue(}, late)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, Foo)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ listener: beginMember()
+ parseFields(late, null, null, null, null, late, null, late, Instance of 'SimpleType', z2, DeclarationKind.Class, Foo, false)
+ listener: beginFields(late)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(z2)
+ listener: handleType(int, null)
+ ensureIdentifierPotentiallyRecovered(int, fieldDeclaration, false)
+ listener: handleIdentifier(z2, fieldDeclaration)
+ parseFieldInitializerOpt(z2, z2, late, null, null, null, DeclarationKind.Class, Foo)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, late, null, 1, int, ;)
+ listener: endMember()
+ notEofOrValue(}, late)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, Foo)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ listener: beginMember()
+ parseFields(late, null, null, null, null, late, null, late, Instance of 'SimpleTypeWith1Argument', x3, DeclarationKind.Class, Foo, false)
+ listener: beginFields(late)
+ listener: handleIdentifier(List, typeReference)
+ listener: beginTypeArguments(<)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(>)
+ listener: handleType(int, null)
+ listener: endTypeArguments(1, <, >)
+ listener: handleType(List, null)
+ ensureIdentifierPotentiallyRecovered(>, fieldDeclaration, false)
+ listener: handleIdentifier(x3, fieldDeclaration)
+ parseFieldInitializerOpt(x3, x3, late, null, null, null, DeclarationKind.Class, Foo)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, late, null, 1, List, ;)
+ listener: endMember()
+ notEofOrValue(}, late)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, Foo)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ indicatesMethodOrField(;)
+ reportRecoverableErrorWithToken(late, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'late' is only available in null safe libraries., null, {token: late}], late, late)
+ listener: beginMember()
+ parseFields(late, null, null, null, null, late, final, final, Instance of 'SimpleType', z4, DeclarationKind.Class, Foo, false)
+ listener: beginFields(late)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(z4)
+ listener: handleType(int, null)
+ ensureIdentifierPotentiallyRecovered(int, fieldDeclaration, false)
+ listener: handleIdentifier(z4, fieldDeclaration)
+ parseFieldInitializerOpt(z4, z4, late, null, null, final, DeclarationKind.Class, Foo)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, late, final, 1, final, ;)
+ listener: endMember()
+ notEofOrValue(}, late)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, Foo)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseFields(;, null, null, null, null, null, null, ;, Instance of 'SimpleType', z5, DeclarationKind.Class, Foo, false)
+ listener: beginFields(;)
+ listener: handleIdentifier(late, typeReference)
+ listener: handleNoTypeArguments(z5)
+ listener: handleType(late, null)
+ ensureIdentifierPotentiallyRecovered(late, fieldDeclaration, false)
+ listener: handleIdentifier(z5, fieldDeclaration)
+ parseFieldInitializerOpt(z5, z5, null, null, null, null, DeclarationKind.Class, Foo)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, null, null, 1, late, ;)
+ listener: endMember()
+ notEofOrValue(}, ;)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, Foo)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(;)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ recoverFromInvalidMember(;, ;, null, null, null, null, null, null, ;, Instance of 'NoType', null, DeclarationKind.Class, Foo)
+ reportRecoverableErrorWithToken(;, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {token: ;}], ;, ;)
+ listener: handleInvalidMember(;)
+ listener: endMember()
+ notEofOrValue(}, late)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, Foo)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(late)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ isReservedKeyword(;)
+ parseFields(;, null, null, null, null, null, null, ;, Instance of 'NoType', late, DeclarationKind.Class, Foo, false)
+ listener: beginFields(;)
+ reportRecoverableError(late, MissingConstFinalVarOrType)
+ listener: handleRecoverableError(MissingConstFinalVarOrType, late, late)
+ listener: handleNoType(;)
+ ensureIdentifierPotentiallyRecovered(;, fieldDeclaration, false)
+ listener: handleIdentifier(late, fieldDeclaration)
+ parseFieldInitializerOpt(late, late, null, null, null, null, DeclarationKind.Class, Foo)
+ listener: handleNoFieldInitializer(;)
+ listener: endClassFields(null, null, null, null, null, null, 1, late, ;)
+ listener: endMember()
+ notEofOrValue(}, ;)
+ parseClassOrMixinOrExtensionMemberImpl(;, DeclarationKind.Class, Foo)
+ parseMetadataStar(;)
+ listener: beginMetadataStar(;)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ recoverFromInvalidMember(;, ;, null, null, null, null, null, null, ;, Instance of 'NoType', null, DeclarationKind.Class, Foo)
+ reportRecoverableErrorWithToken(;, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[ExpectedClassMember, Expected a class member, but got ';'., null, {token: ;}], ;, ;)
+ listener: handleInvalidMember(;)
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 8, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(int)
+ listener: endCompilationUnit(10, )
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.parser.expect b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.parser.expect
new file mode 100644
index 0000000..272afaa
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.parser.expect
@@ -0,0 +1,61 @@
+int x1;
+late int x2;
+late List<int> x3;
+late final int x4;
+late x5;
+;
+late;
+;
+
+main(List<String> args) {
+int y1;
+late int y2;
+late List<int> y3;
+late final int y4;
+late y5;
+;
+late;
+;
+}
+
+class Foo {
+int z1;
+late int z2;
+late List<int> x3;
+late final int z4;
+late z5;
+;
+late;
+;
+}
+
+int[StringToken] x1[StringToken];[SimpleToken]
+late[StringToken] int[StringToken] x2[StringToken];[SimpleToken]
+late[StringToken] List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] x3[StringToken];[SimpleToken]
+late[StringToken] final[KeywordToken] int[StringToken] x4[StringToken];[SimpleToken]
+late[StringToken] x5[StringToken];[SimpleToken]
+;[SimpleToken]
+late[StringToken];[SimpleToken]
+;[SimpleToken]
+
+main[StringToken]([BeginToken]List[StringToken]<[BeginToken]String[StringToken]>[SimpleToken] args[StringToken])[SimpleToken] {[BeginToken]
+int[StringToken] y1[StringToken];[SimpleToken]
+late[StringToken] int[StringToken] y2[StringToken];[SimpleToken]
+late[StringToken] List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] y3[StringToken];[SimpleToken]
+late[StringToken] final[KeywordToken] int[StringToken] y4[StringToken];[SimpleToken]
+late[StringToken] y5[StringToken];[SimpleToken]
+;[SimpleToken]
+late[StringToken];[SimpleToken]
+;[SimpleToken]
+}[SimpleToken]
+
+class[KeywordToken] Foo[StringToken] {[BeginToken]
+int[StringToken] z1[StringToken];[SimpleToken]
+late[StringToken] int[StringToken] z2[StringToken];[SimpleToken]
+late[StringToken] List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] x3[StringToken];[SimpleToken]
+late[StringToken] final[KeywordToken] int[StringToken] z4[StringToken];[SimpleToken]
+late[StringToken] z5[StringToken];[SimpleToken]
+;[SimpleToken]
+late[StringToken];[SimpleToken]
+;[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.scanner.expect b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.scanner.expect
new file mode 100644
index 0000000..272afaa
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_late_in_non_nnbd.dart.scanner.expect
@@ -0,0 +1,61 @@
+int x1;
+late int x2;
+late List<int> x3;
+late final int x4;
+late x5;
+;
+late;
+;
+
+main(List<String> args) {
+int y1;
+late int y2;
+late List<int> y3;
+late final int y4;
+late y5;
+;
+late;
+;
+}
+
+class Foo {
+int z1;
+late int z2;
+late List<int> x3;
+late final int z4;
+late z5;
+;
+late;
+;
+}
+
+int[StringToken] x1[StringToken];[SimpleToken]
+late[StringToken] int[StringToken] x2[StringToken];[SimpleToken]
+late[StringToken] List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] x3[StringToken];[SimpleToken]
+late[StringToken] final[KeywordToken] int[StringToken] x4[StringToken];[SimpleToken]
+late[StringToken] x5[StringToken];[SimpleToken]
+;[SimpleToken]
+late[StringToken];[SimpleToken]
+;[SimpleToken]
+
+main[StringToken]([BeginToken]List[StringToken]<[BeginToken]String[StringToken]>[SimpleToken] args[StringToken])[SimpleToken] {[BeginToken]
+int[StringToken] y1[StringToken];[SimpleToken]
+late[StringToken] int[StringToken] y2[StringToken];[SimpleToken]
+late[StringToken] List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] y3[StringToken];[SimpleToken]
+late[StringToken] final[KeywordToken] int[StringToken] y4[StringToken];[SimpleToken]
+late[StringToken] y5[StringToken];[SimpleToken]
+;[SimpleToken]
+late[StringToken];[SimpleToken]
+;[SimpleToken]
+}[SimpleToken]
+
+class[KeywordToken] Foo[StringToken] {[BeginToken]
+int[StringToken] z1[StringToken];[SimpleToken]
+late[StringToken] int[StringToken] z2[StringToken];[SimpleToken]
+late[StringToken] List[StringToken]<[BeginToken]int[StringToken]>[SimpleToken] x3[StringToken];[SimpleToken]
+late[StringToken] final[KeywordToken] int[StringToken] z4[StringToken];[SimpleToken]
+late[StringToken] z5[StringToken];[SimpleToken]
+;[SimpleToken]
+late[StringToken];[SimpleToken]
+;[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart
new file mode 100644
index 0000000..bc770a6
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart
@@ -0,0 +1,17 @@
+void foo1({required int x1}) {
+ print(x);
+}
+
+void foo2({required x2}) {
+ print(x);
+}
+
+void foo3({required required x3}) {
+ print(x);
+}
+
+class Foo {
+ void foo4({required covariant int x4}) {
+ print(x);
+ }
+}
\ No newline at end of file
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.expect b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.expect
new file mode 100644
index 0000000..691490c
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.expect
@@ -0,0 +1,175 @@
+Problems reported:
+
+parser/non-nnbd/use_required_in_non_nnbd:1:12: The modifier 'required' is only available in null safe libraries.
+void foo1({required int x1}) {
+ ^^^^^^^^
+
+parser/non-nnbd/use_required_in_non_nnbd:9:12: The modifier 'required' is only available in null safe libraries.
+void foo3({required required x3}) {
+ ^^^^^^^^
+
+parser/non-nnbd/use_required_in_non_nnbd:14:14: The modifier 'required' is only available in null safe libraries.
+ void foo4({required covariant int x4}) {
+ ^^^^^^^^
+
+beginCompilationUnit(void)
+ beginMetadataStar(void)
+ endMetadataStar(0)
+ beginTopLevelMember(void)
+ beginTopLevelMethod(, null)
+ handleVoidKeyword(void)
+ handleIdentifier(foo1, topLevelFunctionDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ beginOptionalFormalParameters({)
+ beginMetadataStar(required)
+ endMetadataStar(0)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'required' is only available in null safe libraries., null, {token: required}], required, required)
+ beginFormalParameter(int, MemberKind.TopLevelMethod, required, null, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x1)
+ handleType(int, null)
+ handleIdentifier(x1, formalParameterDeclaration)
+ handleFormalParameterWithoutValue(})
+ endFormalParameter(null, null, x1, null, null, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ endOptionalFormalParameters(1, {, })
+ endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ handleIdentifier(print, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(x, expression)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(x, ))
+ endArguments(1, (, ))
+ handleSend(print, ;)
+ handleExpressionStatement(;)
+ endBlockFunctionBody(1, {, })
+ endTopLevelMethod(void, null, })
+ endTopLevelDeclaration(void)
+ beginMetadataStar(void)
+ endMetadataStar(0)
+ beginTopLevelMember(void)
+ beginTopLevelMethod(}, null)
+ handleVoidKeyword(void)
+ handleIdentifier(foo2, topLevelFunctionDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ beginOptionalFormalParameters({)
+ beginMetadataStar(required)
+ endMetadataStar(0)
+ beginFormalParameter(required, MemberKind.TopLevelMethod, null, null, null)
+ handleIdentifier(required, typeReference)
+ handleNoTypeArguments(x2)
+ handleType(required, null)
+ handleIdentifier(x2, formalParameterDeclaration)
+ handleFormalParameterWithoutValue(})
+ endFormalParameter(null, null, x2, null, null, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ endOptionalFormalParameters(1, {, })
+ endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ handleIdentifier(print, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(x, expression)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(x, ))
+ endArguments(1, (, ))
+ handleSend(print, ;)
+ handleExpressionStatement(;)
+ endBlockFunctionBody(1, {, })
+ endTopLevelMethod(void, null, })
+ endTopLevelDeclaration(void)
+ beginMetadataStar(void)
+ endMetadataStar(0)
+ beginTopLevelMember(void)
+ beginTopLevelMethod(}, null)
+ handleVoidKeyword(void)
+ handleIdentifier(foo3, topLevelFunctionDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.TopLevelMethod)
+ beginOptionalFormalParameters({)
+ beginMetadataStar(required)
+ endMetadataStar(0)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'required' is only available in null safe libraries., null, {token: required}], required, required)
+ beginFormalParameter(required, MemberKind.TopLevelMethod, required, null, null)
+ handleIdentifier(required, typeReference)
+ handleNoTypeArguments(x3)
+ handleType(required, null)
+ handleIdentifier(x3, formalParameterDeclaration)
+ handleFormalParameterWithoutValue(})
+ endFormalParameter(null, null, x3, null, null, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ endOptionalFormalParameters(1, {, })
+ endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ handleIdentifier(print, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(x, expression)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(x, ))
+ endArguments(1, (, ))
+ handleSend(print, ;)
+ handleExpressionStatement(;)
+ endBlockFunctionBody(1, {, })
+ endTopLevelMethod(void, null, })
+ endTopLevelDeclaration(class)
+ beginMetadataStar(class)
+ endMetadataStar(0)
+ beginClassOrNamedMixinApplicationPrelude(class)
+ handleIdentifier(Foo, classOrMixinDeclaration)
+ handleNoTypeVariables({)
+ beginClassDeclaration(class, null, Foo)
+ handleNoType(Foo)
+ handleClassExtends(null, 1)
+ handleClassNoWithClause()
+ handleClassOrMixinImplements(null, 0)
+ handleClassHeader(class, class, null)
+ beginClassOrMixinBody(DeclarationKind.Class, {)
+ beginMetadataStar(void)
+ endMetadataStar(0)
+ beginMember()
+ beginMethod(null, null, null, null, null, foo4)
+ handleVoidKeyword(void)
+ handleIdentifier(foo4, methodDeclaration)
+ handleNoTypeVariables(()
+ beginFormalParameters((, MemberKind.NonStaticMethod)
+ beginOptionalFormalParameters({)
+ beginMetadataStar(required)
+ endMetadataStar(0)
+ handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'required' is only available in null safe libraries., null, {token: required}], required, required)
+ beginFormalParameter(covariant, MemberKind.NonStaticMethod, required, covariant, null)
+ handleIdentifier(int, typeReference)
+ handleNoTypeArguments(x4)
+ handleType(int, null)
+ handleIdentifier(x4, formalParameterDeclaration)
+ handleFormalParameterWithoutValue(})
+ endFormalParameter(null, null, x4, null, null, FormalParameterKind.optionalNamed, MemberKind.NonStaticMethod)
+ endOptionalFormalParameters(1, {, })
+ endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ handleNoInitializers()
+ handleAsyncModifier(null, null)
+ beginBlockFunctionBody({)
+ handleIdentifier(print, expression)
+ handleNoTypeArguments(()
+ beginArguments(()
+ handleIdentifier(x, expression)
+ handleNoTypeArguments())
+ handleNoArguments())
+ handleSend(x, ))
+ endArguments(1, (, ))
+ handleSend(print, ;)
+ handleExpressionStatement(;)
+ endBlockFunctionBody(1, {, })
+ endClassMethod(null, void, (, null, })
+ endMember()
+ endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ endClassDeclaration(class, })
+ endTopLevelDeclaration()
+endCompilationUnit(4, )
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.intertwined.expect b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.intertwined.expect
new file mode 100644
index 0000000..0450aa8
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.intertwined.expect
@@ -0,0 +1,360 @@
+parseUnit(void)
+ skipErrorTokens(void)
+ listener: beginCompilationUnit(void)
+ syntheticPreviousToken(void)
+ parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
+ parseMetadataStar()
+ listener: beginMetadataStar(void)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl()
+ listener: beginTopLevelMember(void)
+ parseTopLevelMethod(, null, , Instance of 'VoidType', null, foo1, false)
+ listener: beginTopLevelMethod(, null)
+ listener: handleVoidKeyword(void)
+ ensureIdentifierPotentiallyRecovered(void, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(foo1, topLevelFunctionDeclaration)
+ parseMethodTypeVar(foo1)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(foo1, foo1, false, MemberKind.TopLevelMethod)
+ parseFormalParameters(foo1, MemberKind.TopLevelMethod)
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ parseOptionalNamedParameters((, MemberKind.TopLevelMethod)
+ listener: beginOptionalFormalParameters({)
+ parseFormalParameter({, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ parseMetadataStar({)
+ listener: beginMetadataStar(required)
+ listener: endMetadataStar(0)
+ reportRecoverableErrorWithToken(required, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'required' is only available in null safe libraries., null, {token: required}], required, required)
+ listener: beginFormalParameter(int, MemberKind.TopLevelMethod, required, null, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x1)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(x1, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue(})
+ listener: endFormalParameter(null, null, x1, null, null, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ listener: endOptionalFormalParameters(1, {, })
+ ensureCloseParen(}, ()
+ listener: endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, print)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(print)
+ parseExpressionStatement({)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ looksLikeFunctionBody(;)
+ parseSend({, expression)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(print, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(print)
+ parseArguments(print)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(x, expression)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(x)
+ listener: handleNoArguments())
+ listener: handleSend(x, ))
+ listener: endArguments(1, (, ))
+ listener: handleSend(print, ;)
+ ensureSemicolon())
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endTopLevelMethod(void, null, })
+ listener: endTopLevelDeclaration(void)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(void)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(})
+ listener: beginTopLevelMember(void)
+ parseTopLevelMethod(}, null, }, Instance of 'VoidType', null, foo2, false)
+ listener: beginTopLevelMethod(}, null)
+ listener: handleVoidKeyword(void)
+ ensureIdentifierPotentiallyRecovered(void, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(foo2, topLevelFunctionDeclaration)
+ parseMethodTypeVar(foo2)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(foo2, foo2, false, MemberKind.TopLevelMethod)
+ parseFormalParameters(foo2, MemberKind.TopLevelMethod)
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ parseOptionalNamedParameters((, MemberKind.TopLevelMethod)
+ listener: beginOptionalFormalParameters({)
+ parseFormalParameter({, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ parseMetadataStar({)
+ listener: beginMetadataStar(required)
+ listener: endMetadataStar(0)
+ listener: beginFormalParameter(required, MemberKind.TopLevelMethod, null, null, null)
+ listener: handleIdentifier(required, typeReference)
+ listener: handleNoTypeArguments(x2)
+ listener: handleType(required, null)
+ ensureIdentifier(required, formalParameterDeclaration)
+ listener: handleIdentifier(x2, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue(})
+ listener: endFormalParameter(null, null, x2, null, null, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ listener: endOptionalFormalParameters(1, {, })
+ ensureCloseParen(}, ()
+ listener: endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, print)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(print)
+ parseExpressionStatement({)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ looksLikeFunctionBody(;)
+ parseSend({, expression)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(print, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(print)
+ parseArguments(print)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(x, expression)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(x)
+ listener: handleNoArguments())
+ listener: handleSend(x, ))
+ listener: endArguments(1, (, ))
+ listener: handleSend(print, ;)
+ ensureSemicolon())
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endTopLevelMethod(void, null, })
+ listener: endTopLevelDeclaration(void)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(void)
+ listener: endMetadataStar(0)
+ parseTopLevelMemberImpl(})
+ listener: beginTopLevelMember(void)
+ parseTopLevelMethod(}, null, }, Instance of 'VoidType', null, foo3, false)
+ listener: beginTopLevelMethod(}, null)
+ listener: handleVoidKeyword(void)
+ ensureIdentifierPotentiallyRecovered(void, topLevelFunctionDeclaration, false)
+ listener: handleIdentifier(foo3, topLevelFunctionDeclaration)
+ parseMethodTypeVar(foo3)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(foo3, foo3, false, MemberKind.TopLevelMethod)
+ parseFormalParameters(foo3, MemberKind.TopLevelMethod)
+ parseFormalParametersRest((, MemberKind.TopLevelMethod)
+ listener: beginFormalParameters((, MemberKind.TopLevelMethod)
+ parseOptionalNamedParameters((, MemberKind.TopLevelMethod)
+ listener: beginOptionalFormalParameters({)
+ parseFormalParameter({, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ parseMetadataStar({)
+ listener: beginMetadataStar(required)
+ listener: endMetadataStar(0)
+ reportRecoverableErrorWithToken(required, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'required' is only available in null safe libraries., null, {token: required}], required, required)
+ listener: beginFormalParameter(required, MemberKind.TopLevelMethod, required, null, null)
+ listener: handleIdentifier(required, typeReference)
+ listener: handleNoTypeArguments(x3)
+ listener: handleType(required, null)
+ ensureIdentifier(required, formalParameterDeclaration)
+ listener: handleIdentifier(x3, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue(})
+ listener: endFormalParameter(null, null, x3, null, null, FormalParameterKind.optionalNamed, MemberKind.TopLevelMethod)
+ listener: endOptionalFormalParameters(1, {, })
+ ensureCloseParen(}, ()
+ listener: endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ parseFunctionBody(), false, false)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, print)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(print)
+ parseExpressionStatement({)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ looksLikeFunctionBody(;)
+ parseSend({, expression)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(print, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(print)
+ parseArguments(print)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(x, expression)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(x)
+ listener: handleNoArguments())
+ listener: handleSend(x, ))
+ listener: endArguments(1, (, ))
+ listener: handleSend(print, ;)
+ ensureSemicolon())
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endTopLevelMethod(void, null, })
+ listener: endTopLevelDeclaration(class)
+ parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
+ parseMetadataStar(})
+ listener: beginMetadataStar(class)
+ listener: endMetadataStar(0)
+ parseTopLevelKeywordDeclaration(}, class, Instance of 'DirectiveContext')
+ parseClassDeclarationModifiers(}, class)
+ parseClassOrNamedMixinApplication(null, class)
+ listener: beginClassOrNamedMixinApplicationPrelude(class)
+ ensureIdentifier(class, classOrMixinDeclaration)
+ listener: handleIdentifier(Foo, classOrMixinDeclaration)
+ listener: handleNoTypeVariables({)
+ listener: beginClassDeclaration(class, null, Foo)
+ parseClass(Foo, class, class, Foo)
+ parseClassHeaderOpt(Foo, class, class)
+ parseClassExtendsOpt(Foo)
+ listener: handleNoType(Foo)
+ listener: handleClassExtends(null, 1)
+ parseWithClauseOpt(Foo)
+ listener: handleClassNoWithClause()
+ parseClassOrMixinImplementsOpt(Foo)
+ listener: handleClassOrMixinImplements(null, 0)
+ listener: handleClassHeader(class, class, null)
+ parseClassOrMixinOrExtensionBody(Foo, DeclarationKind.Class, Foo)
+ listener: beginClassOrMixinBody(DeclarationKind.Class, {)
+ notEofOrValue(}, void)
+ parseClassOrMixinOrExtensionMemberImpl({, DeclarationKind.Class, Foo)
+ parseMetadataStar({)
+ listener: beginMetadataStar(void)
+ listener: endMetadataStar(0)
+ listener: beginMember()
+ parseMethod({, null, null, null, null, null, null, {, Instance of 'VoidType', null, foo4, DeclarationKind.Class, Foo, false)
+ listener: beginMethod(null, null, null, null, null, foo4)
+ listener: handleVoidKeyword(void)
+ ensureIdentifierPotentiallyRecovered(void, methodDeclaration, false)
+ listener: handleIdentifier(foo4, methodDeclaration)
+ parseQualifiedRestOpt(foo4, methodDeclarationContinuation)
+ parseMethodTypeVar(foo4)
+ listener: handleNoTypeVariables(()
+ parseGetterOrFormalParameters(foo4, foo4, false, MemberKind.NonStaticMethod)
+ parseFormalParameters(foo4, MemberKind.NonStaticMethod)
+ parseFormalParametersRest((, MemberKind.NonStaticMethod)
+ listener: beginFormalParameters((, MemberKind.NonStaticMethod)
+ parseOptionalNamedParameters((, MemberKind.NonStaticMethod)
+ listener: beginOptionalFormalParameters({)
+ parseFormalParameter({, FormalParameterKind.optionalNamed, MemberKind.NonStaticMethod)
+ parseMetadataStar({)
+ listener: beginMetadataStar(required)
+ listener: endMetadataStar(0)
+ reportRecoverableErrorWithToken(required, Instance of 'Template<(Token) => Message>')
+ listener: handleRecoverableError(Message[UnexpectedModifierInNonNnbd, The modifier 'required' is only available in null safe libraries., null, {token: required}], required, required)
+ listener: beginFormalParameter(covariant, MemberKind.NonStaticMethod, required, covariant, null)
+ listener: handleIdentifier(int, typeReference)
+ listener: handleNoTypeArguments(x4)
+ listener: handleType(int, null)
+ ensureIdentifier(int, formalParameterDeclaration)
+ listener: handleIdentifier(x4, formalParameterDeclaration)
+ listener: handleFormalParameterWithoutValue(})
+ listener: endFormalParameter(null, null, x4, null, null, FormalParameterKind.optionalNamed, MemberKind.NonStaticMethod)
+ listener: endOptionalFormalParameters(1, {, })
+ ensureCloseParen(}, ()
+ listener: endFormalParameters(1, (, ), MemberKind.NonStaticMethod)
+ parseInitializersOpt())
+ listener: handleNoInitializers()
+ parseAsyncModifierOpt())
+ listener: handleAsyncModifier(null, null)
+ inPlainSync()
+ inPlainSync()
+ parseFunctionBody(), false, true)
+ listener: beginBlockFunctionBody({)
+ notEofOrValue(}, print)
+ parseStatement({)
+ parseStatementX({)
+ parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, false)
+ looksLikeLocalFunction(print)
+ parseExpressionStatement({)
+ parseExpression({)
+ parsePrecedenceExpression({, 1, true)
+ parseUnaryExpression({, true)
+ parsePrimary({, expression)
+ parseSendOrFunctionLiteral({, expression)
+ looksLikeFunctionBody(;)
+ parseSend({, expression)
+ ensureIdentifier({, expression)
+ listener: handleIdentifier(print, expression)
+ listener: handleNoTypeArguments(()
+ parseArgumentsOpt(print)
+ parseArguments(print)
+ parseArgumentsRest(()
+ listener: beginArguments(()
+ parseExpression(()
+ parsePrecedenceExpression((, 1, true)
+ parseUnaryExpression((, true)
+ parsePrimary((, expression)
+ parseSendOrFunctionLiteral((, expression)
+ parseSend((, expression)
+ ensureIdentifier((, expression)
+ listener: handleIdentifier(x, expression)
+ listener: handleNoTypeArguments())
+ parseArgumentsOpt(x)
+ listener: handleNoArguments())
+ listener: handleSend(x, ))
+ listener: endArguments(1, (, ))
+ listener: handleSend(print, ;)
+ ensureSemicolon())
+ listener: handleExpressionStatement(;)
+ notEofOrValue(}, })
+ listener: endBlockFunctionBody(1, {, })
+ listener: endClassMethod(null, void, (, null, })
+ listener: endMember()
+ notEofOrValue(}, })
+ listener: endClassOrMixinBody(DeclarationKind.Class, 1, {, })
+ listener: endClassDeclaration(class, })
+ listener: endTopLevelDeclaration()
+ reportAllErrorTokens(void)
+ listener: endCompilationUnit(4, )
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.parser.expect b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.parser.expect
new file mode 100644
index 0000000..468262a
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.parser.expect
@@ -0,0 +1,35 @@
+void foo1({required int x1}) {
+print(x);
+}
+
+void foo2({required x2}) {
+print(x);
+}
+
+void foo3({required required x3}) {
+print(x);
+}
+
+class Foo {
+void foo4({required covariant int x4}) {
+print(x);
+}
+}
+
+void[KeywordToken] foo1[StringToken]([BeginToken]{[BeginToken]required[StringToken] int[StringToken] x1[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+
+void[KeywordToken] foo2[StringToken]([BeginToken]{[BeginToken]required[StringToken] x2[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+
+void[KeywordToken] foo3[StringToken]([BeginToken]{[BeginToken]required[StringToken] required[StringToken] x3[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+
+class[KeywordToken] Foo[StringToken] {[BeginToken]
+void[KeywordToken] foo4[StringToken]([BeginToken]{[BeginToken]required[StringToken] covariant[KeywordToken] int[StringToken] x4[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.scanner.expect b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.scanner.expect
new file mode 100644
index 0000000..468262a
--- /dev/null
+++ b/pkg/front_end/parser_testcases/non-nnbd/use_required_in_non_nnbd.dart.scanner.expect
@@ -0,0 +1,35 @@
+void foo1({required int x1}) {
+print(x);
+}
+
+void foo2({required x2}) {
+print(x);
+}
+
+void foo3({required required x3}) {
+print(x);
+}
+
+class Foo {
+void foo4({required covariant int x4}) {
+print(x);
+}
+}
+
+void[KeywordToken] foo1[StringToken]([BeginToken]{[BeginToken]required[StringToken] int[StringToken] x1[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+
+void[KeywordToken] foo2[StringToken]([BeginToken]{[BeginToken]required[StringToken] x2[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+
+void[KeywordToken] foo3[StringToken]([BeginToken]{[BeginToken]required[StringToken] required[StringToken] x3[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+
+class[KeywordToken] Foo[StringToken] {[BeginToken]
+void[KeywordToken] foo4[StringToken]([BeginToken]{[BeginToken]required[StringToken] covariant[KeywordToken] int[StringToken] x4[StringToken]}[SimpleToken])[SimpleToken] {[BeginToken]
+print[StringToken]([BeginToken]x[StringToken])[SimpleToken];[SimpleToken]
+}[SimpleToken]
+}[SimpleToken][SimpleToken]
diff --git a/pkg/front_end/test/crashing_test_case_minimizer_impl.dart b/pkg/front_end/test/crashing_test_case_minimizer_impl.dart
index 8bda7f4..328e3a7 100644
--- a/pkg/front_end/test/crashing_test_case_minimizer_impl.dart
+++ b/pkg/front_end/test/crashing_test_case_minimizer_impl.dart
@@ -154,6 +154,13 @@
}
}
+// TODO(jensj): The different cuts and inlines in this file aren't tested.
+// The probably should be. So they should probably be factored out so they can
+// be tested and then tested.
+// Similarly the whole +/- 1 thing to cut out what we want is weird and should
+// be factored out into helpers too, or we should have some sort of visitor
+// that can include the "real" numbers (which should then also be tested).
+
class TestMinimizer {
final TestMinimizerSettings _settings;
_FakeFileSystem get _fs => _settings._fs;
@@ -177,7 +184,8 @@
stdin.echoMode = false;
stdin.lineMode = false;
} catch (e) {
- print("error setting settings on stdin");
+ print("Trying to setup 'stdin' failed. Continuing anyway, "
+ "but 'q', 'i' etc might not work.");
}
_stdinSubscription = stdin.listen((List<int> event) {
if (event.length == 1 && event.single == "q".codeUnits.single) {
@@ -544,6 +552,10 @@
_replaceRange(replacements, originalBytes);
// Step 2: Find the last import/export.
+ // TODO(jensj): This doesn't work if
+ // * The file we're inlining into doesn't have any imports/exports but do
+ // have a `library` declaration.
+ // * The file we're inlining has a library declaration.
int offsetOfLast = 0;
ast = getAST(withoutInlineable,
includeBody: false,
@@ -1423,6 +1435,10 @@
}
// Try to remove "extends", "implements" etc.
+ // TODO(jensj): The below removes from the "extends" (etc) until
+ // (but excluding) the "{". This should be improved so it can remove
+ // _one_ part at a time. E:g. if it says "class A implements B, C {"
+ // we could try to remove "B, " or ", C" etc.
if (decl.getClassExtends().extendsKeyword != null) {
helper.replacements.add(new _Replacement(
decl.getClassExtends().extendsKeyword.offset - 1,
@@ -1758,6 +1774,8 @@
try {
_latestComponent = await incrementalCompiler.computeDelta();
if (_settings.serialize) {
+ // We're asked to serialize, probably because it crashes in
+ // serialization.
ByteSink sink = new ByteSink();
BinaryPrinter printer = new BinaryPrinter(sink);
printer.writeComponentFile(_latestComponent);
@@ -1767,6 +1785,8 @@
incrementalCompiler.invalidate(uri);
Component delta = await incrementalCompiler.computeDelta();
if (_settings.serialize) {
+ // We're asked to serialize, probably because it crashes in
+ // serialization.
ByteSink sink = new ByteSink();
BinaryPrinter printer = new BinaryPrinter(sink);
printer.writeComponentFile(delta);
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index 49cac17..3d73127 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -153,6 +153,7 @@
ctrl
cumulative
cursor
+cuts
cx
dacoharkes
dadd
@@ -347,9 +348,11 @@
incrementally
increments
indents
+ing
initializer2
inlinable
inlineable
+inlines
instance2
insufficient
intdiv
diff --git a/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.textual_outline.expect
index 4e4aaf6..042fbfc 100644
--- a/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/covariant_late_field.dart.textual_outline.expect
@@ -1,6 +1,6 @@
class A {
- late num ;
- invariantField;
+ late
+ num invariantField;
covariant late num ;
covariantField;
}
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline.expect
index 1932ec0..5e18cfd 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline.expect
@@ -2,12 +2,9 @@
methodDirect<T>(T value) {}
var fieldDirect = <T>(T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
local2 = value;
local4 = 0;
local6 = 0;
@@ -17,12 +14,9 @@
};
methodConditional<T>(bool b, T value) {}
var fieldConditional = <T>(bool b, T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
if (b) {
local2 = value;
local4 = 0;
@@ -37,8 +31,7 @@
};
methodCompound() {}
var fieldCompound = () {
- late;
- final int local4;
+ late final int local4;
local4 = 0;
local4 += 0;
};
diff --git a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline_modelled.expect
index be04eb0..ba94702 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline_modelled.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_assigned.dart.textual_outline_modelled.expect
@@ -5,18 +5,14 @@
methodConditional<T>(bool b, T value) {}
methodDirect<T>(T value) {}
var fieldCompound = () {
- late;
- final int local4;
+ late final int local4;
local4 = 0;
local4 += 0;
};
var fieldConditional = <T>(bool b, T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
if (b) {
local2 = value;
local4 = 0;
@@ -30,12 +26,9 @@
local6 = 0;
};
var fieldDirect = <T>(T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
local2 = value;
local4 = 0;
local6 = 0;
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline.expect
index 8b2d8e6..7c35b6a 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline.expect
@@ -1,8 +1,53 @@
import 'dart:async';
+
methodDirect<T>(T value) {}
-var fieldDirect = <T>(T value) { T local1; late T ;local2; int local3; late int ;local4; FutureOr<int> local5; late FutureOr;<int> [];local6; late T ;local7 = value; local1; local2; local3; local4; local5; local6; local7; };
+var fieldDirect = <T>(T value) {
+ T local1;
+ late T local2;
+ int local3;
+ late int local4;
+ FutureOr<int> local5;
+ late FutureOr<int> local6;
+ late T local7 = value;
+ local1;
+ local2;
+ local3;
+ local4;
+ local5;
+ local6;
+ local7;
+};
methodConditional<T>(bool b, T value) {}
-var fieldConditional = <T>(bool b, T value) { T local1; late T ;local2; int local3; late int ;local4; FutureOr<int> local5; late FutureOr;<int> [];local6; late T ;local7 = value; if (b) { local1 = value; local2 = value; local3 = 0; local4 = 0; local5 = 0; local6 = 0; local7; } local1; local2; local3; local4; local5; local6; local7; };
+var fieldConditional = <T>(bool b, T value) {
+ T local1;
+ late T local2;
+ int local3;
+ late int local4;
+ FutureOr<int> local5;
+ late FutureOr<int> local6;
+ late T local7 = value;
+ if (b) {
+ local1 = value;
+ local2 = value;
+ local3 = 0;
+ local4 = 0;
+ local5 = 0;
+ local6 = 0;
+ local7;
+ }
+ local1;
+ local2;
+ local3;
+ local4;
+ local5;
+ local6;
+ local7;
+};
methodCompound() {}
-var fieldCompound = () { int local3; late int ;local4; local3 += 0; local4 += 0; };
+var fieldCompound = () {
+ int local3;
+ late int local4;
+ local3 += 0;
+ local4 += 0;
+};
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline_modelled.expect
index 46a4371..10d1b40 100644
--- a/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline_modelled.expect
+++ b/pkg/front_end/testcases/late_lowering/definitely_unassigned.dart.textual_outline_modelled.expect
@@ -6,24 +6,18 @@
methodDirect<T>(T value) {}
var fieldCompound = () {
int local3;
- late int;
- local4;
+ late int local4;
local3 += 0;
local4 += 0;
};
var fieldConditional = <T>(bool b, T value) {
T local1;
- late T;
- local2;
+ late T local2;
int local3;
- late int;
- local4;
+ late int local4;
FutureOr<int> local5;
- late FutureOr;
- <int>[];
- local6;
- late T;
- local7 = value;
+ late FutureOr<int> local6;
+ late T local7 = value;
if (b) {
local1 = value;
local2 = value;
@@ -43,17 +37,12 @@
};
var fieldDirect = <T>(T value) {
T local1;
- late T;
- local2;
+ late T local2;
int local3;
- late int;
- local4;
+ late int local4;
FutureOr<int> local5;
- late FutureOr;
- <int>[];
- local6;
- late T;
- local7 = value;
+ late FutureOr<int> local6;
+ late T local7 = value;
local1;
local2;
local3;
diff --git a/pkg/front_end/testcases/late_lowering/getter_vs_setter_type.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/getter_vs_setter_type.dart.textual_outline.expect
index 2045647..2470729 100644
--- a/pkg/front_end/testcases/late_lowering/getter_vs_setter_type.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/getter_vs_setter_type.dart.textual_outline.expect
@@ -1,19 +1,18 @@
abstract class A {
- late int ;
- property4;
- late int;
- operator? (){}
- property5;
+ late
+ int property4;
+ late
+ int? property5;
covariant late int ;
property6;
A(this.property4, this.property5, this.property6);
}
abstract class B1 {
- late ;
+ late
final int property4;
- late ;
+ late
final int property5;
- late ;
+ late
final int? property6;
B1(this.property4, this.property5, this.property6);
}
@@ -23,12 +22,12 @@
void set property6(int i);
}
abstract class C1 {
- late int ;
- property4;
- late int ;
- property5;
- late int ;
- property6;
+ late
+ int property4;
+ late
+ int property5;
+ late
+ int property6;
C1(this.property4, this.property5, this.property6);
}
abstract class C2 implements C1 {
diff --git a/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.textual_outline.expect
index 4b4ba1f..6df6180 100644
--- a/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/initializer_rewrite.dart.textual_outline.expect
@@ -1,8 +1,8 @@
int nonNullableTopLevelFieldReads = 0;
-late ;
+late
final int nonNullableTopLevelField = nonNullableTopLevelFieldReads++ == 0 ? nonNullableTopLevelField + 1 : 0;
int nullableTopLevelFieldReads = 0;
-late ;
+late
final int? nullableTopLevelField = nullableTopLevelFieldReads++ == 0 ? nullableTopLevelField.hashCode : 0;
class Class {
static int nonNullableStaticFieldReads = 0;
@@ -12,10 +12,10 @@
static late ;
final int? nullableStaticField = nullableStaticFieldReads++ == 0 ? nullableStaticField.hashCode : 0;
int nonNullableInstanceFieldReads = 0;
- late ;
+ late
final int nonNullableInstanceField = nonNullableInstanceFieldReads++ == 0 ? nonNullableInstanceField + 1 : 0;
int nullableInstanceFieldReads = 0;
- late ;
+ late
final int? nullableInstanceField = nullableInstanceFieldReads++ == 0 ? nullableInstanceField.hashCode : 0;
}
void main() {}
diff --git a/pkg/front_end/testcases/late_lowering/initializer_rewrite_from_opt_out.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/initializer_rewrite_from_opt_out.dart.textual_outline.expect
index 181da77..6a82617 100644
--- a/pkg/front_end/testcases/late_lowering/initializer_rewrite_from_opt_out.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/initializer_rewrite_from_opt_out.dart.textual_outline.expect
@@ -1,9 +1,9 @@
import 'initializer_rewrite_from_opt_out_lib.dart';
int nonNullableTopLevelFieldReads = 0;
-late ;
+late
final int nonNullableTopLevelField = nonNullableTopLevelFieldReads++ == 0 ? nonNullableTopLevelField : computeInitialValue();
int nullableTopLevelFieldReads = 0;
-late ;
+late
final int? nullableTopLevelField = nullableTopLevelFieldReads++ == 0 ? nullableTopLevelField : computeInitialValue();
class Class {
static int nonNullableStaticFieldReads = 0;
@@ -13,10 +13,10 @@
static late ;
final int? nullableStaticField = nullableStaticFieldReads++ == 0 ? nullableStaticField : computeInitialValue();
int nonNullableInstanceFieldReads = 0;
- late ;
+ late
final int nonNullableInstanceField = nonNullableInstanceFieldReads++ == 0 ? nonNullableInstanceField : computeInitialValue();
int nullableInstanceFieldReads = 0;
- late ;
+ late
final int? nullableInstanceField = nullableInstanceFieldReads++ == 0 ? nullableInstanceField : computeInitialValue();
}
void main() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.textual_outline.expect
index 27c1e25..a65dd27 100644
--- a/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.textual_outline.expect
@@ -1,17 +1,18 @@
class Class {
- late int ;
- field = 10;
+ late int field = 10;
Class.constructor1();
Class.constructor2(this.field);
Class.constructor3(int value) : this.field = value + 1;
Class.constructor4([this.field = 42]);
}
+
class Subclass extends Class {
Subclass.constructor1() : super.constructor1();
Subclass.constructor2(int value) : super.constructor2(value);
Subclass.constructor3(int value) : super.constructor3(value);
Subclass.constructor4([int value = 87]) : super.constructor4(value);
}
+
test1() {}
test2() {}
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..dc89fb9
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/instance_field_with_initializer.dart.textual_outline_modelled.expect
@@ -0,0 +1,20 @@
+class Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ Class.constructor1();
+ Class.constructor2(this.field);
+ Class.constructor3(int value) : this.field = value + 1;
+ Class.constructor4([this.field = 42]);
+ int field = 10;
+}
+class Subclass extends Class {
+ Subclass.constructor1() : super.constructor1();
+ Subclass.constructor2(int value) : super.constructor2(value);
+ Subclass.constructor3(int value) : super.constructor3(value);
+ Subclass.constructor4([int value = 87]) : super.constructor4(value);
+}
+expect(expected, actual) {}
+main() {}
+test1() {}
+test2() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.textual_outline.expect
index fc1edad..b4a35e3 100644
--- a/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.textual_outline.expect
@@ -1,17 +1,18 @@
class Class {
- late int ;
- field;
+ late int field;
Class.constructor1();
Class.constructor2(this.field);
Class.constructor3(int value) : this.field = value + 1;
Class.constructor4([this.field = 42]);
}
+
class Subclass extends Class {
Subclass.constructor1() : super.constructor1();
Subclass.constructor2(int value) : super.constructor2(value);
Subclass.constructor3(int value) : super.constructor3(value);
Subclass.constructor4([int value = 87]) : super.constructor4(value);
}
+
test1() {}
test2() {}
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..342930e
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/instance_field_without_initializer.dart.textual_outline_modelled.expect
@@ -0,0 +1,21 @@
+class Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ Class.constructor1();
+ Class.constructor2(this.field);
+ Class.constructor3(int value) : this.field = value + 1;
+ Class.constructor4([this.field = 42]);
+ int field;
+}
+class Subclass extends Class {
+ Subclass.constructor1() : super.constructor1();
+ Subclass.constructor2(int value) : super.constructor2(value);
+ Subclass.constructor3(int value) : super.constructor3(value);
+ Subclass.constructor4([int value = 87]) : super.constructor4(value);
+}
+expect(expected, actual) {}
+main() {}
+test1() {}
+test2() {}
+throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.textual_outline.expect
index 05f1676..b950438 100644
--- a/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.textual_outline.expect
@@ -1,17 +1,18 @@
class Class {
- late ;
- final int field;
+ late final int field;
Class.constructor1();
Class.constructor2(this.field);
Class.constructor3(int value) : this.field = value + 1;
Class.constructor4([this.field = 42]);
}
+
class Subclass extends Class {
Subclass.constructor1() : super.constructor1();
Subclass.constructor2(int value) : super.constructor2(value);
Subclass.constructor3(int value) : super.constructor3(value);
Subclass.constructor4([int value = 87]) : super.constructor4(value);
}
+
test1() {}
test2() {}
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..21f03d0
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/instance_final_field_without_initializer.dart.textual_outline_modelled.expect
@@ -0,0 +1,21 @@
+class Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ Class.constructor1();
+ Class.constructor2(this.field);
+ Class.constructor3(int value) : this.field = value + 1;
+ Class.constructor4([this.field = 42]);
+ final int field;
+}
+class Subclass extends Class {
+ Subclass.constructor1() : super.constructor1();
+ Subclass.constructor2(int value) : super.constructor2(value);
+ Subclass.constructor3(int value) : super.constructor3(value);
+ Subclass.constructor4([int value = 87]) : super.constructor4(value);
+}
+expect(expected, actual) {}
+main() {}
+test1() {}
+test2() {}
+throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_nullable_field_with_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/instance_nullable_field_with_initializer.dart.textual_outline.expect
index ece8159..9da4eef 100644
--- a/pkg/front_end/testcases/late_lowering/instance_nullable_field_with_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_nullable_field_with_initializer.dart.textual_outline.expect
@@ -1,19 +1,20 @@
int? initField() => 10;
+
class Class {
- late int;
- operator? (){}
- field = initField();
+ late int? field = initField();
Class.constructor1();
Class.constructor2(this.field);
Class.constructor3(int value) : this.field = value + 1;
Class.constructor4([this.field = 42]);
}
+
class Subclass extends Class {
Subclass.constructor1() : super.constructor1();
Subclass.constructor2(int value) : super.constructor2(value);
Subclass.constructor3(int value) : super.constructor3(value);
Subclass.constructor4([int value = 87]) : super.constructor4(value);
}
+
test1() {}
test2() {}
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_nullable_field_with_initializer.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/instance_nullable_field_with_initializer.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..f6e9106
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/instance_nullable_field_with_initializer.dart.textual_outline_modelled.expect
@@ -0,0 +1,21 @@
+class Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ Class.constructor1();
+ Class.constructor2(this.field);
+ Class.constructor3(int value) : this.field = value + 1;
+ Class.constructor4([this.field = 42]);
+ int? field = initField();
+}
+class Subclass extends Class {
+ Subclass.constructor1() : super.constructor1();
+ Subclass.constructor2(int value) : super.constructor2(value);
+ Subclass.constructor3(int value) : super.constructor3(value);
+ Subclass.constructor4([int value = 87]) : super.constructor4(value);
+}
+expect(expected, actual) {}
+int? initField() => 10;
+main() {}
+test1() {}
+test2() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_nullable_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/instance_nullable_field_without_initializer.dart.textual_outline.expect
index d595eca..69c707c 100644
--- a/pkg/front_end/testcases/late_lowering/instance_nullable_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_nullable_field_without_initializer.dart.textual_outline.expect
@@ -1,18 +1,18 @@
class Class {
- late int;
- operator? (){}
- field;
+ late int? field;
Class.constructor1();
Class.constructor2(this.field);
Class.constructor3(int value) : this.field = value + 1;
Class.constructor4([this.field = 42]);
}
+
class Subclass extends Class {
Subclass.constructor1() : super.constructor1();
Subclass.constructor2(int value) : super.constructor2(value);
Subclass.constructor3(int value) : super.constructor3(value);
Subclass.constructor4([int value = 87]) : super.constructor4(value);
}
+
test1() {}
test2() {}
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_nullable_field_without_initializer.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/instance_nullable_field_without_initializer.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..5750785
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/instance_nullable_field_without_initializer.dart.textual_outline_modelled.expect
@@ -0,0 +1,21 @@
+class Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ Class.constructor1();
+ Class.constructor2(this.field);
+ Class.constructor3(int value) : this.field = value + 1;
+ Class.constructor4([this.field = 42]);
+ int? field;
+}
+class Subclass extends Class {
+ Subclass.constructor1() : super.constructor1();
+ Subclass.constructor2(int value) : super.constructor2(value);
+ Subclass.constructor3(int value) : super.constructor3(value);
+ Subclass.constructor4([int value = 87]) : super.constructor4(value);
+}
+expect(expected, actual) {}
+main() {}
+test1() {}
+test2() {}
+throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_nullable_final_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/instance_nullable_final_field_without_initializer.dart.textual_outline.expect
index cfc9fd3..14cc7955 100644
--- a/pkg/front_end/testcases/late_lowering/instance_nullable_final_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/instance_nullable_final_field_without_initializer.dart.textual_outline.expect
@@ -1,17 +1,18 @@
class Class {
- late ;
- final int? field;
+ late final int? field;
Class.constructor1();
Class.constructor2(this.field);
Class.constructor3(int value) : this.field = value + 1;
Class.constructor4([this.field = 42]);
}
+
class Subclass extends Class {
Subclass.constructor1() : super.constructor1();
Subclass.constructor2(int value) : super.constructor2(value);
Subclass.constructor3(int value) : super.constructor3(value);
Subclass.constructor4([int value = 87]) : super.constructor4(value);
}
+
test1() {}
test2() {}
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/instance_nullable_final_field_without_initializer.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/instance_nullable_final_field_without_initializer.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..196bf87
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/instance_nullable_final_field_without_initializer.dart.textual_outline_modelled.expect
@@ -0,0 +1,21 @@
+class Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ Class.constructor1();
+ Class.constructor2(this.field);
+ Class.constructor3(int value) : this.field = value + 1;
+ Class.constructor4([this.field = 42]);
+ final int? field;
+}
+class Subclass extends Class {
+ Subclass.constructor1() : super.constructor1();
+ Subclass.constructor2(int value) : super.constructor2(value);
+ Subclass.constructor3(int value) : super.constructor3(value);
+ Subclass.constructor4([int value = 87]) : super.constructor4(value);
+}
+expect(expected, actual) {}
+main() {}
+test1() {}
+test2() {}
+throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/issue40373.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/issue40373.dart.textual_outline.expect
index 654ad93..f1b177b 100644
--- a/pkg/front_end/testcases/late_lowering/issue40373.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/issue40373.dart.textual_outline.expect
@@ -1,7 +1,7 @@
class C {
num pi = 3.14;
- late num ;
- p1 = this.pi;
+ late
+ num p1 = this.pi;
late ;
final p2 = this.pi;
}
diff --git a/pkg/front_end/testcases/late_lowering/issue41436b.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/issue41436b.dart.textual_outline.expect
index af1e25c..b38c3b2 100644
--- a/pkg/front_end/testcases/late_lowering/issue41436b.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/issue41436b.dart.textual_outline.expect
@@ -1,8 +1,9 @@
abstract class A {
- late int ;
- x;
+ late int x;
}
+
class _B implements A {
int x = 3;
}
+
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/issue41436b.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/issue41436b.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..8364103
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/issue41436b.dart.textual_outline_modelled.expect
@@ -0,0 +1,10 @@
+abstract class A {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ int x;
+}
+class _B implements A {
+ int x = 3;
+}
+main() {}
diff --git a/pkg/front_end/testcases/late_lowering/issue42407.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/issue42407.dart.textual_outline.expect
index aad20ad..f848f78 100644
--- a/pkg/front_end/testcases/late_lowering/issue42407.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/issue42407.dart.textual_outline.expect
@@ -1,12 +1,13 @@
class A<T> {
- late T ;
- x;
+ late T x;
}
+
class B<T> {
T? _y;
T? get y => _y;
set y(T? val) {}
}
+
main() {}
expect(expected, actual) {}
throws(void Function() f) {}
diff --git a/pkg/front_end/testcases/late_lowering/issue42407.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/issue42407.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..fe9c799
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/issue42407.dart.textual_outline_modelled.expect
@@ -0,0 +1,14 @@
+class A<T> {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ T x;
+}
+class B<T> {
+ T? _y;
+ T? get y => _y;
+ set y(T? val) {}
+}
+expect(expected, actual) {}
+main() {}
+throws(void Function() f) {}
diff --git a/pkg/front_end/testcases/late_lowering/late_annotations.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_annotations.dart.textual_outline.expect
index 9c08694..e03605b 100644
--- a/pkg/front_end/testcases/late_lowering/late_annotations.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_annotations.dart.textual_outline.expect
@@ -2,23 +2,23 @@
const Annotation();
}
@Annotation()
-late int ;
-topLevelField;
+late
+int topLevelField;
@Annotation()
-late ;
+late
final int finalTopLevelField;
@Annotation()
-late ;
+late
final int finalTopLevelFieldWithInitializer = 0;
class A {
@Annotation()
- late int ;
- instanceField;
+ late
+ int instanceField;
@Annotation()
- late ;
+ late
final int finalInstanceField;
@Annotation()
- late ;
+ late
final int finalInstanceFieldWithInitializer = 0;
@Annotation()
covariant late num ;
@@ -35,13 +35,13 @@
}
mixin B {
@Annotation()
- late int ;
- instanceField;
+ late
+ int instanceField;
@Annotation()
- late ;
+ late
final int finalInstanceField;
@Annotation()
- late ;
+ late
final int finalInstanceFieldWithInitializer = 0;
@Annotation()
covariant late num ;
diff --git a/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.textual_outline.expect
index 44ab46b..3c8b258 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_with_initializer.dart.textual_outline.expect
@@ -1,18 +1,18 @@
-late int ;
-lateTopLevelField1 = 123;
+late
+int lateTopLevelField1 = 123;
class Class<T> {
static late int ;
lateStaticField1 = 87;
static late int ;
lateStaticField2 = 42;
static staticMethod() {}
- late int ;
- lateInstanceField = 16;
+ late
+ int lateInstanceField = 16;
final T field;
- late T ;
- lateGenericField1 = field;
- late T ;
- lateGenericField2 = field;
+ late
+ T lateGenericField1 = field;
+ late
+ T lateGenericField2 = field;
Class(this.field);
instanceMethod(T value) {}
}
diff --git a/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.textual_outline.expect
index 4d948d2..a79477b 100644
--- a/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_field_without_initializer.dart.textual_outline.expect
@@ -1,15 +1,15 @@
-late int ;
-lateTopLevelField;
+late
+int lateTopLevelField;
class Class<T> {
static late int ;
lateStaticField1;
static late int ;
lateStaticField2;
static staticMethod() {}
- late int ;
- lateInstanceField;
- late T ;
- lateGenericInstanceField;
+ late
+ int lateInstanceField;
+ late
+ T lateGenericInstanceField;
instanceMethod(T value) {}
}
extension Extension<T> (){}
diff --git a/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.textual_outline.expect
index 09efd13..eb122a4 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_field_with_initializer.dart.textual_outline.expect
@@ -10,7 +10,7 @@
}
int? lateTopLevelField1Init;
int initLateTopLevelField1(int value) {}
-late ;
+late
final int lateTopLevelField1 = initLateTopLevelField1(123);
class Class<T> {
static int? lateStaticField1Init;
@@ -24,12 +24,12 @@
static staticMethod() {}
int? lateInstanceFieldInit;
int initLateInstanceField(int value) {}
- late ;
+ late
final int lateInstanceField = initLateInstanceField(16);
T? lateGenericFieldInit;
T initLateGenericField(T value) {}
final T field;
- late ;
+ late
final T lateGenericField = initLateGenericField(field);
Class(this.field);
instanceMethod() {}
diff --git a/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.textual_outline.expect
index 7d7bf93..e1be8d4 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_field_without_initializer.dart.textual_outline.expect
@@ -1,4 +1,4 @@
-late ;
+late
final int lateTopLevelField;
class Class {
static late ;
@@ -6,7 +6,7 @@
static late ;
final int lateStaticField2;
static staticMethod() {}
- late ;
+ late
final int lateInstanceField;
instanceMethod() {}
}
diff --git a/pkg/front_end/testcases/late_lowering/late_final_nullable_field_with_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_final_nullable_field_with_initializer.dart.textual_outline.expect
index fe6b1c3..3a9e54e 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_nullable_field_with_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_nullable_field_with_initializer.dart.textual_outline.expect
@@ -1,6 +1,6 @@
int? lateTopLevelField1Init;
int? initLateTopLevelField1(int value) {}
-late ;
+late
final int? lateTopLevelField1 = initLateTopLevelField1(123);
class Class<T> {
static int? lateStaticField1Init;
@@ -14,12 +14,12 @@
static staticMethod() {}
int? lateInstanceFieldInit;
int? initLateInstanceField(int value) {}
- late ;
+ late
final int? lateInstanceField = initLateInstanceField(16);
T? lateGenericInstanceFieldInit;
T? initLateGenericInstanceField(T? value) {}
final T? field;
- late ;
+ late
final T? lateGenericInstanceField = initLateGenericInstanceField(field);
Class(this.field);
instanceMethod() {}
diff --git a/pkg/front_end/testcases/late_lowering/late_final_nullable_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_final_nullable_field_without_initializer.dart.textual_outline.expect
index 4d93692..d82d349 100644
--- a/pkg/front_end/testcases/late_lowering/late_final_nullable_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_final_nullable_field_without_initializer.dart.textual_outline.expect
@@ -1,4 +1,4 @@
-late ;
+late
final int? lateTopLevelField;
class Class<T> {
static late ;
@@ -6,9 +6,9 @@
static late ;
final int? lateStaticField2;
static staticMethod() {}
- late ;
+ late
final int? lateInstanceField;
- late ;
+ late
final T? lateGenericInstanceField;
instanceMethod(T value) {}
}
diff --git a/pkg/front_end/testcases/late_lowering/late_future_or.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_future_or.dart.textual_outline.expect
index fc1c0c8..234fa27 100644
--- a/pkg/front_end/testcases/late_lowering/late_future_or.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_future_or.dart.textual_outline.expect
@@ -18,18 +18,16 @@
late ;
var field6 = method6();
class C<T> {
- late FutureOr ;
- field1;
- late FutureOr;
- operator? (){}
- field2;
- late FutureOr<T> (){}
- field3;
- late FutureOr<T?> (){}
- field4;
- late FutureOr<T?>(){}
- operator? (){}
- field5;
+ late
+ FutureOr field1;
+ late
+ FutureOr? field2;
+ late
+ FutureOr<T> field3;
+ late
+ FutureOr<T?> field4;
+ late
+ FutureOr<T?>? field5;
method() {}
}
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/late_lowering_bitmasks.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_lowering_bitmasks.dart.textual_outline.expect
index 83c95c1..f3cbcfe 100644
--- a/pkg/front_end/testcases/late_lowering/late_lowering_bitmasks.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_lowering_bitmasks.dart.textual_outline.expect
@@ -1,12 +1,12 @@
main() {}
method() {}
-late int ;
-uninitializedNonFinalTopLevelField;
-late ;
+late
+int uninitializedNonFinalTopLevelField;
+late
final int uninitializedFinalTopLevelField;
-late int ;
-initializedNonFinalTopLevelField = 0;
-late ;
+late
+int initializedNonFinalTopLevelField = 0;
+late
final int initializedFinalTopLevelField = 0;
class Class {
static late int ;
@@ -17,12 +17,12 @@
initializedNonFinalStaticField = 0;
static late ;
final int initializedFinalStaticField = 0;
- late int ;
- uninitializedNonFinalInstanceField;
- late ;
+ late
+ int uninitializedNonFinalInstanceField;
+ late
final int uninitializedFinalInstanceField;
- late int ;
- initializedNonFinalInstanceField = 0;
- late ;
+ late
+ int initializedNonFinalInstanceField = 0;
+ late
final int initializedFinalInstanceField = 0;
}
diff --git a/pkg/front_end/testcases/late_lowering/late_nullable_field_with_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_nullable_field_with_initializer.dart.textual_outline.expect
index c0352a0..7804754 100644
--- a/pkg/front_end/testcases/late_lowering/late_nullable_field_with_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_nullable_field_with_initializer.dart.textual_outline.expect
@@ -1,7 +1,6 @@
int? lateTopLevelField1Init() => 123;
-late int;
-?
-lateTopLevelField1 = lateTopLevelField1Init();
+late
+int? lateTopLevelField1 = lateTopLevelField1Init();
class Class<T> {
static int? lateStaticField1Init() => 87;
static late int;
@@ -13,14 +12,12 @@
lateStaticField2 = lateStaticField2Init();
static staticMethod() {}
int? lateInstanceFieldInit() => 16;
- late int;
- operator? (){}
- lateInstanceField = lateInstanceFieldInit();
+ late
+ int? lateInstanceField = lateInstanceFieldInit();
final T? field;
T? lateGenericInstanceFieldInit() => field;
- late T;
- operator? (){}
- lateGenericInstanceField = lateGenericInstanceFieldInit();
+ late
+ T? lateGenericInstanceField = lateGenericInstanceFieldInit();
Class(this.field);
instanceMethod(T? value) {}
}
diff --git a/pkg/front_end/testcases/late_lowering/late_nullable_field_without_initializer.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/late_nullable_field_without_initializer.dart.textual_outline.expect
index f958db7..aab13f1 100644
--- a/pkg/front_end/testcases/late_lowering/late_nullable_field_without_initializer.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/late_nullable_field_without_initializer.dart.textual_outline.expect
@@ -1,6 +1,5 @@
-late int;
-?
-lateTopLevelField;
+late
+int? lateTopLevelField;
class Class<T> {
static late int;
operator? (){}
@@ -9,12 +8,10 @@
operator? (){}
lateStaticField2;
static staticMethod() {}
- late int;
- operator? (){}
- lateInstanceField;
- late T;
- operator? (){}
- lateGenericInstanceField;
+ late
+ int? lateInstanceField;
+ late
+ T? lateGenericInstanceField;
instanceMethod(T? value) {}
}
extension Extension<T> (){}
diff --git a/pkg/front_end/testcases/late_lowering/later.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/later.dart.textual_outline.expect
index ba6d922..ec9372a 100644
--- a/pkg/front_end/testcases/late_lowering/later.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/later.dart.textual_outline.expect
@@ -1,8 +1,8 @@
// @dart = 2.9999
class A {
int a = 42;
- late int ;
- b = (this.a * 2) >> 1;
+ late
+ int b = (this.a * 2) >> 1;
foo(late int x) {}
}
bar(late int x) {}
@@ -10,12 +10,12 @@
hest() async {}
fisk() async {}
class B {
- late ;
+ late
final int x = 42;
const B();
}
class C {
- late ;
+ late
final int x;
initVars() {}
}
diff --git a/pkg/front_end/testcases/late_lowering/override.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/override.dart.textual_outline.expect
index b463007..cfa03cf 100644
--- a/pkg/front_end/testcases/late_lowering/override.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/override.dart.textual_outline.expect
@@ -1,22 +1,15 @@
class Class {
- late int ;
- field1;
- late int ;
- field2;
- late ;
- final int field3;
- late ;
- final int field4;
+ late int field1;
+ late int field2;
+ late final int field3;
+ late final int field4;
}
+
class SubClass extends Class {
- late int ;
- field1;
- late int ;
- field2 = 0;
- late ;
- final int field3;
- late ;
- final int field4 = 0;
+ late int field1;
+ late int field2 = 0;
+ late final int field3;
+ late final int field4 = 0;
int get directField1 => super.field1;
void set directField1(int value) {}
int get directField2 => super.field2;
@@ -24,6 +17,7 @@
int get directField3 => super.field3;
int get directField4 => super.field4;
}
+
main() {}
expect(expected, actual) {}
throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/override.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/override.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..42e50bd
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/override.dart.textual_outline_modelled.expect
@@ -0,0 +1,45 @@
+class Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ int field1;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ int field2;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int field3;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int field4;
+}
+class SubClass extends Class {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ int field1;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ int field2 = 0;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int field3;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int field4 = 0;
+ int get directField1 => super.field1;
+ int get directField2 => super.field2;
+ int get directField3 => super.field3;
+ int get directField4 => super.field4;
+ void set directField1(int value) {}
+ void set directField2(int value) {}
+}
+expect(expected, actual) {}
+main() {}
+throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.textual_outline.expect
index 4594586..a38c2ae 100644
--- a/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.textual_outline.expect
@@ -1,19 +1,18 @@
class A {
- late ;
- final int x;
- late ;
- final int? y;
+ late final int x;
+ late final int? y;
}
+
class B extends A {
int get x => 1;
int? get y => 1;
}
+
class C extends A {
- late ;
- final int x = 2;
- late ;
- final int? y = 2;
+ late final int x = 2;
+ late final int? y = 2;
}
+
main() {}
expect(expected, actual) {}
throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..5650775
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/override_getter_setter.dart.textual_outline_modelled.expect
@@ -0,0 +1,27 @@
+class A {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int x;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int? y;
+}
+class B extends A {
+ int? get y => 1;
+ int get x => 1;
+}
+class C extends A {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int x = 2;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int? y = 2;
+}
+expect(expected, actual) {}
+main() {}
+throws(f(), String message) {}
diff --git a/pkg/front_end/testcases/late_lowering/skip_late_final_uninitialized_instance_fields/main.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/skip_late_final_uninitialized_instance_fields/main.dart.textual_outline.expect
index 83c95c1..f3cbcfe 100644
--- a/pkg/front_end/testcases/late_lowering/skip_late_final_uninitialized_instance_fields/main.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/skip_late_final_uninitialized_instance_fields/main.dart.textual_outline.expect
@@ -1,12 +1,12 @@
main() {}
method() {}
-late int ;
-uninitializedNonFinalTopLevelField;
-late ;
+late
+int uninitializedNonFinalTopLevelField;
+late
final int uninitializedFinalTopLevelField;
-late int ;
-initializedNonFinalTopLevelField = 0;
-late ;
+late
+int initializedNonFinalTopLevelField = 0;
+late
final int initializedFinalTopLevelField = 0;
class Class {
static late int ;
@@ -17,12 +17,12 @@
initializedNonFinalStaticField = 0;
static late ;
final int initializedFinalStaticField = 0;
- late int ;
- uninitializedNonFinalInstanceField;
- late ;
+ late
+ int uninitializedNonFinalInstanceField;
+ late
final int uninitializedFinalInstanceField;
- late int ;
- initializedNonFinalInstanceField = 0;
- late ;
+ late
+ int initializedNonFinalInstanceField = 0;
+ late
final int initializedFinalInstanceField = 0;
}
diff --git a/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.textual_outline.expect
index 7432afc..2fcb7a6 100644
--- a/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.textual_outline.expect
@@ -1,7 +1,7 @@
class A {
- late int ;
- x;
+ late int x;
A.foo(this.x);
A.bar();
}
+
main() {}
diff --git a/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..16afc20
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering/uninitialized_non_nullable_late_fields.dart.textual_outline_modelled.expect
@@ -0,0 +1,9 @@
+class A {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ A.bar();
+ A.foo(this.x);
+ int x;
+}
+main() {}
diff --git a/pkg/front_end/testcases/late_lowering_sentinel/late_fields.dart.textual_outline.expect b/pkg/front_end/testcases/late_lowering_sentinel/late_fields.dart.textual_outline.expect
index 521d4d6..9e2ee67 100644
--- a/pkg/front_end/testcases/late_lowering_sentinel/late_fields.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/late_lowering_sentinel/late_fields.dart.textual_outline.expect
@@ -1,21 +1,10 @@
-late int;
-?
-nullableTopLevelField;
-late int ;
-nonNullableTopLevelField;
-late int;
-?
-nullableTopLevelFieldWithInitializer = null;
-late int ;
-nonNullableTopLevelFieldWithInitializer = 0;
-late ;
-final int? nullableFinalTopLevelField;
-late ;
-final int nonNullableFinalTopLevelField;
-late ;
-final int? nullableFinalTopLevelFieldWithInitializer = null;
-late ;
-final int nonNullableFinalTopLevelFieldWithInitializer = 0;
-late Never ;
-neverTopLevelField;
+late int? nullableTopLevelField;
+late int nonNullableTopLevelField;
+late int? nullableTopLevelFieldWithInitializer = null;
+late int nonNullableTopLevelFieldWithInitializer = 0;
+late final int? nullableFinalTopLevelField;
+late final int nonNullableFinalTopLevelField;
+late final int? nullableFinalTopLevelFieldWithInitializer = null;
+late final int nonNullableFinalTopLevelFieldWithInitializer = 0;
+late Never neverTopLevelField;
main() {}
diff --git a/pkg/front_end/testcases/late_lowering_sentinel/late_fields.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/late_lowering_sentinel/late_fields.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..8b9ef40
--- /dev/null
+++ b/pkg/front_end/testcases/late_lowering_sentinel/late_fields.dart.textual_outline_modelled.expect
@@ -0,0 +1,37 @@
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+int? nullableTopLevelField;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+int nonNullableTopLevelField;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+int? nullableTopLevelFieldWithInitializer = null;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+int nonNullableTopLevelFieldWithInitializer = 0;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+final int? nullableFinalTopLevelField;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+final int nonNullableFinalTopLevelField;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+final int? nullableFinalTopLevelFieldWithInitializer = null;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+final int nonNullableFinalTopLevelFieldWithInitializer = 0;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+Never neverTopLevelField;
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/covariant_late_field.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/covariant_late_field.dart.textual_outline.expect
index 4e4aaf6..042fbfc 100644
--- a/pkg/front_end/testcases/nnbd/covariant_late_field.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/covariant_late_field.dart.textual_outline.expect
@@ -1,6 +1,6 @@
class A {
- late num ;
- invariantField;
+ late
+ num invariantField;
covariant late num ;
covariantField;
}
diff --git a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline.expect
index 1932ec0..5e18cfd 100644
--- a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline.expect
@@ -2,12 +2,9 @@
methodDirect<T>(T value) {}
var fieldDirect = <T>(T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
local2 = value;
local4 = 0;
local6 = 0;
@@ -17,12 +14,9 @@
};
methodConditional<T>(bool b, T value) {}
var fieldConditional = <T>(bool b, T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
if (b) {
local2 = value;
local4 = 0;
@@ -37,8 +31,7 @@
};
methodCompound() {}
var fieldCompound = () {
- late;
- final int local4;
+ late final int local4;
local4 = 0;
local4 += 0;
};
diff --git a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline_modelled.expect
index be04eb0..ba94702 100644
--- a/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline_modelled.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_assigned.dart.textual_outline_modelled.expect
@@ -5,18 +5,14 @@
methodConditional<T>(bool b, T value) {}
methodDirect<T>(T value) {}
var fieldCompound = () {
- late;
- final int local4;
+ late final int local4;
local4 = 0;
local4 += 0;
};
var fieldConditional = <T>(bool b, T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
if (b) {
local2 = value;
local4 = 0;
@@ -30,12 +26,9 @@
local6 = 0;
};
var fieldDirect = <T>(T value) {
- late;
- final T local2;
- late;
- final int local4;
- late;
- final FutureOr<int> local6;
+ late final T local2;
+ late final int local4;
+ late final FutureOr<int> local6;
local2 = value;
local4 = 0;
local6 = 0;
diff --git a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline.expect
index 8b2d8e6..7c35b6a 100644
--- a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline.expect
@@ -1,8 +1,53 @@
import 'dart:async';
+
methodDirect<T>(T value) {}
-var fieldDirect = <T>(T value) { T local1; late T ;local2; int local3; late int ;local4; FutureOr<int> local5; late FutureOr;<int> [];local6; late T ;local7 = value; local1; local2; local3; local4; local5; local6; local7; };
+var fieldDirect = <T>(T value) {
+ T local1;
+ late T local2;
+ int local3;
+ late int local4;
+ FutureOr<int> local5;
+ late FutureOr<int> local6;
+ late T local7 = value;
+ local1;
+ local2;
+ local3;
+ local4;
+ local5;
+ local6;
+ local7;
+};
methodConditional<T>(bool b, T value) {}
-var fieldConditional = <T>(bool b, T value) { T local1; late T ;local2; int local3; late int ;local4; FutureOr<int> local5; late FutureOr;<int> [];local6; late T ;local7 = value; if (b) { local1 = value; local2 = value; local3 = 0; local4 = 0; local5 = 0; local6 = 0; local7; } local1; local2; local3; local4; local5; local6; local7; };
+var fieldConditional = <T>(bool b, T value) {
+ T local1;
+ late T local2;
+ int local3;
+ late int local4;
+ FutureOr<int> local5;
+ late FutureOr<int> local6;
+ late T local7 = value;
+ if (b) {
+ local1 = value;
+ local2 = value;
+ local3 = 0;
+ local4 = 0;
+ local5 = 0;
+ local6 = 0;
+ local7;
+ }
+ local1;
+ local2;
+ local3;
+ local4;
+ local5;
+ local6;
+ local7;
+};
methodCompound() {}
-var fieldCompound = () { int local3; late int ;local4; local3 += 0; local4 += 0; };
+var fieldCompound = () {
+ int local3;
+ late int local4;
+ local3 += 0;
+ local4 += 0;
+};
main() {}
diff --git a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline_modelled.expect
index 46a4371..10d1b40 100644
--- a/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline_modelled.expect
+++ b/pkg/front_end/testcases/nnbd/definitely_unassigned.dart.textual_outline_modelled.expect
@@ -6,24 +6,18 @@
methodDirect<T>(T value) {}
var fieldCompound = () {
int local3;
- late int;
- local4;
+ late int local4;
local3 += 0;
local4 += 0;
};
var fieldConditional = <T>(bool b, T value) {
T local1;
- late T;
- local2;
+ late T local2;
int local3;
- late int;
- local4;
+ late int local4;
FutureOr<int> local5;
- late FutureOr;
- <int>[];
- local6;
- late T;
- local7 = value;
+ late FutureOr<int> local6;
+ late T local7 = value;
if (b) {
local1 = value;
local2 = value;
@@ -43,17 +37,12 @@
};
var fieldDirect = <T>(T value) {
T local1;
- late T;
- local2;
+ late T local2;
int local3;
- late int;
- local4;
+ late int local4;
FutureOr<int> local5;
- late FutureOr;
- <int>[];
- local6;
- late T;
- local7 = value;
+ late FutureOr<int> local6;
+ late T local7 = value;
local1;
local2;
local3;
diff --git a/pkg/front_end/testcases/nnbd/getter_vs_setter_type_late.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/getter_vs_setter_type_late.dart.textual_outline.expect
index 2045647..2470729 100644
--- a/pkg/front_end/testcases/nnbd/getter_vs_setter_type_late.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/getter_vs_setter_type_late.dart.textual_outline.expect
@@ -1,19 +1,18 @@
abstract class A {
- late int ;
- property4;
- late int;
- operator? (){}
- property5;
+ late
+ int property4;
+ late
+ int? property5;
covariant late int ;
property6;
A(this.property4, this.property5, this.property6);
}
abstract class B1 {
- late ;
+ late
final int property4;
- late ;
+ late
final int property5;
- late ;
+ late
final int? property6;
B1(this.property4, this.property5, this.property6);
}
@@ -23,12 +22,12 @@
void set property6(int i);
}
abstract class C1 {
- late int ;
- property4;
- late int ;
- property5;
- late int ;
- property6;
+ late
+ int property4;
+ late
+ int property5;
+ late
+ int property6;
C1(this.property4, this.property5, this.property6);
}
abstract class C2 implements C1 {
diff --git a/pkg/front_end/testcases/nnbd/issue42967.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue42967.dart.textual_outline.expect
index 003e9d3..dab2d82 100644
--- a/pkg/front_end/testcases/nnbd/issue42967.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/issue42967.dart.textual_outline.expect
@@ -1,41 +1,39 @@
class A {
num fieldNonNullableOfA;
- late num ;
- fieldLateNonNullableOfA;
+ late num fieldLateNonNullableOfA;
final dynamic fieldFinalDynamicOfA;
- late ;
- final dynamic fieldLateFinalDynamicOfA;
+ late final dynamic fieldLateFinalDynamicOfA;
}
+
abstract class AbstractA {
external num fieldExternalNonNullableOfAbstractA;
abstract num fieldAbstractNonNullableOfAbstractA;
external final dynamic fieldExternalFinalDynamicOfAbstractA;
abstract final dynamic fieldAbstractFinalDynamicOfAbstractA;
}
+
class B {
num fieldNonNullableOfB;
- late num ;
- fieldLateNonNullableOfB;
+ late num fieldLateNonNullableOfB;
final dynamic fieldFinalDynamicOfB;
- late ;
- final dynamic fieldLateFinalDynamicOfB;
+ late final dynamic fieldLateFinalDynamicOfB;
factory B() => throw 42;
}
+
abstract class AbstractB {
external num fieldExternalNonNullableOfAbstractB;
abstract num fieldAbstractNonNullableOfAbstractB;
external final dynamic fieldExternalFinalDynamicOfAbstractB;
abstract final dynamic fieldAbstractFinalDynamicOfAbstractB;
}
+
mixin M {
num fieldNonNullableOfM;
- late num ;
- fieldLateNonNullableOfM;
+ late num fieldLateNonNullableOfM;
external num fieldExternalNonNullableOfM;
abstract num fieldAbstractNonNullableOfM;
final dynamic fieldFinalDynamicOfM;
- late ;
- final dynamic fieldLateFinalDynamicOfM;
+ late final dynamic fieldLateFinalDynamicOfM;
external final dynamic fieldExternalFinalDynamicOfM;
abstract final dynamic fieldAbstractFinalDynamicOfM;
}
diff --git a/pkg/front_end/testcases/nnbd/issue42967.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue42967.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..284430e8
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue42967.dart.textual_outline_modelled.expect
@@ -0,0 +1,54 @@
+abstract class AbstractA {
+ abstract final dynamic fieldAbstractFinalDynamicOfAbstractA;
+ abstract num fieldAbstractNonNullableOfAbstractA;
+ external final dynamic fieldExternalFinalDynamicOfAbstractA;
+ external num fieldExternalNonNullableOfAbstractA;
+}
+abstract class AbstractB {
+ abstract final dynamic fieldAbstractFinalDynamicOfAbstractB;
+ abstract num fieldAbstractNonNullableOfAbstractB;
+ external final dynamic fieldExternalFinalDynamicOfAbstractB;
+ external num fieldExternalNonNullableOfAbstractB;
+}
+class A {
+ num fieldNonNullableOfA;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final dynamic fieldFinalDynamicOfA;
+ num fieldLateNonNullableOfA;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final dynamic fieldLateFinalDynamicOfA;
+}
+class B {
+ num fieldNonNullableOfB;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final dynamic fieldFinalDynamicOfB;
+ num fieldLateNonNullableOfB;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ factory B() => throw 42;
+ final dynamic fieldLateFinalDynamicOfB;
+}
+main() {}
+mixin M {
+ num fieldNonNullableOfM;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ abstract num fieldAbstractNonNullableOfM;
+ external num fieldExternalNonNullableOfM;
+ final dynamic fieldFinalDynamicOfM;
+ num fieldLateNonNullableOfM;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ abstract final dynamic fieldAbstractFinalDynamicOfM;
+ external final dynamic fieldExternalFinalDynamicOfM;
+ final dynamic fieldLateFinalDynamicOfM;
+}
diff --git a/pkg/front_end/testcases/nnbd/issue43354.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue43354.dart.textual_outline.expect
index d4f44a6..579892c 100644
--- a/pkg/front_end/testcases/nnbd/issue43354.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/issue43354.dart.textual_outline.expect
@@ -1,27 +1,25 @@
class A {
- late ;
- final int foo = 42;
+ late final int foo = 42;
const A();
}
+
class B {
- late ;
- final int foo = 42;
- late ;
- final String bar = "foobar";
+ late final int foo = 42;
+ late final String bar = "foobar";
const B();
}
+
class C {
- late ;
- final int foo = 42;
+ late final int foo = 42;
const C();
const C.another();
}
+
class D {
- late ;
- final int foo = 42;
- late ;
- final String bar = "foobar";
+ late final int foo = 42;
+ late final String bar = "foobar";
const D();
const D.another();
}
+
main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43354.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue43354.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..8e86312
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43354.dart.textual_outline_modelled.expect
@@ -0,0 +1,39 @@
+class A {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ const A();
+ final int foo = 42;
+}
+class B {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int foo = 42;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ const B();
+ final String bar = "foobar";
+}
+class C {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ const C();
+ const C.another();
+ final int foo = 42;
+}
+class D {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ final int foo = 42;
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ const D();
+ const D.another();
+ final String bar = "foobar";
+}
+main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43689.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/issue43689.dart.textual_outline.expect
index efaf61b..d26f6fb 100644
--- a/pkg/front_end/testcases/nnbd/issue43689.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/issue43689.dart.textual_outline.expect
@@ -1,6 +1,4 @@
-late ;
-final int y;
-late ;
-final int? y;
+late final int y;
+late final int? y;
test() {}
main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue43689.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/issue43689.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..400ab13
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue43689.dart.textual_outline_modelled.expect
@@ -0,0 +1,10 @@
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+final int y;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+final int? y;
+main() {}
+test() {}
diff --git a/pkg/front_end/testcases/nnbd/late.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/late.dart.textual_outline.expect
index f7b7941..78b3d91 100644
--- a/pkg/front_end/testcases/nnbd/late.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/late.dart.textual_outline.expect
@@ -1,21 +1,21 @@
-late int ;
-lateTopLevelField;
-late ;
+late
+int lateTopLevelField;
+late
final int lateFinalTopLevelField;
-late ;
+late
final int lateFinalTopLevelFieldWithInit = 0;
class Class {
- late int ;
- lateInstanceField;
- late ;
+ late
+ int lateInstanceField;
+ late
final int lateFinalInstanceField1;
- late ;
+ late
final int lateFinalInstanceField2;
- late ;
+ late
final int lateFinalInstanceFieldWithInit = 0;
- late Class ;
- lateInstanceFieldThis = this;
- late ;
+ late
+ Class lateInstanceFieldThis = this;
+ late
final Class lateFinalInstanceFieldThis = this;
static late int ;
lateStaticField;
diff --git a/pkg/front_end/testcases/nnbd/later.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/later.dart.textual_outline.expect
index bf423f2..d06dcad 100644
--- a/pkg/front_end/testcases/nnbd/later.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/later.dart.textual_outline.expect
@@ -1,7 +1,7 @@
class A {
int a = 42;
- late int ;
- b = (this.a * 2) >> 1;
+ late
+ int b = (this.a * 2) >> 1;
foo(late int x) {}
}
bar(late int x) {}
@@ -9,12 +9,12 @@
hest() async {}
fisk() async {}
class B {
- late ;
+ late
final int x = 42;
const B();
}
class C {
- late ;
+ late
final int x;
initVars() {}
}
diff --git a/pkg/front_end/testcases/nnbd/non_nullable_field_initialization.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/non_nullable_field_initialization.dart.textual_outline.expect
index a81aa68..d664bd6 100644
--- a/pkg/front_end/testcases/nnbd/non_nullable_field_initialization.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/non_nullable_field_initialization.dart.textual_outline.expect
@@ -23,8 +23,8 @@
extension P ;
on Foo (){}
int? nullableTopLevelField;
-late int ;
-lateTopLevelField;
+late
+int lateTopLevelField;
int topLevelFieldWithInitializer = 42;
class C<X extends Object?, Y extends Object> {
static int? staticFieldOfX;
@@ -37,12 +37,12 @@
Y? fieldOfX6;
static late int ;
lateStaticFieldOfC;
- late int ;
- fieldOfC7;
- late X ;
- fieldOfC8;
- late Y ;
- fieldOfC9;
+ late
+ int fieldOfC7;
+ late
+ X fieldOfC8;
+ late
+ Y fieldOfC9;
int fieldOfC10;
C.foo(this.fieldOfC10);
C.bar(this.fieldOfC10);
@@ -58,12 +58,12 @@
Y? fieldOfL6;
static late int ;
lateStaticFieldOfM;
- late int ;
- fieldOfM7;
- late X ;
- fieldOfM8;
- late Y ;
- fieldOfM9;
+ late
+ int fieldOfM7;
+ late
+ X fieldOfM8;
+ late
+ Y fieldOfM9;
}
extension Q ;
on Foo (){}
diff --git a/pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart.textual_outline.expect
index 059663f..82cafac 100644
--- a/pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/potentially_non_nullable_field.dart.textual_outline.expect
@@ -1,7 +1,7 @@
int x;
int? y;
-late int ;
-z;
+late
+int z;
class A<T extends Object?> {
static int x;
static int? y;
@@ -9,15 +9,14 @@
z;
int lx;
int? ly;
- late int;
- operator? (){}
- lz;
+ late
+ int? lz;
int lv;
int lu;
T lt;
T? ls;
- late T ;
- lr;
+ late
+ T lr;
T lp;
T lq;
A(this.lv, this.lp, T t) : this.lu = 42, this.lq = t;
diff --git a/pkg/front_end/testcases/nnbd/uninitialized_non_nullable_late_fields.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd/uninitialized_non_nullable_late_fields.dart.textual_outline.expect
index 7432afc..2fcb7a6 100644
--- a/pkg/front_end/testcases/nnbd/uninitialized_non_nullable_late_fields.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd/uninitialized_non_nullable_late_fields.dart.textual_outline.expect
@@ -1,7 +1,7 @@
class A {
- late int ;
- x;
+ late int x;
A.foo(this.x);
A.bar();
}
+
main() {}
diff --git a/pkg/front_end/testcases/nnbd/uninitialized_non_nullable_late_fields.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd/uninitialized_non_nullable_late_fields.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..16afc20
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/uninitialized_non_nullable_late_fields.dart.textual_outline_modelled.expect
@@ -0,0 +1,9 @@
+class A {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ A.bar();
+ A.foo(this.x);
+ int x;
+}
+main() {}
diff --git a/pkg/front_end/testcases/nnbd_mixed/opt_out.dart.textual_outline.expect b/pkg/front_end/testcases/nnbd_mixed/opt_out.dart.textual_outline.expect
index 708b920..be1c56c 100644
--- a/pkg/front_end/testcases/nnbd_mixed/opt_out.dart.textual_outline.expect
+++ b/pkg/front_end/testcases/nnbd_mixed/opt_out.dart.textual_outline.expect
@@ -1,15 +1,16 @@
import 'opt_out_lib.dart';
+
class A<T> {
- late int ;
- field = 42;
+ late int field = 42;
}
+
class B extends A<String?> {}
+
typedef F = void Function()?;
List<String?> l = [];
String? s = null;
var t = s!;
-late int ;
-field = 42;
+late int field = 42;
void method(void f()?, {required int a}) {}
main() {}
noErrors() {}
diff --git a/pkg/front_end/testcases/nnbd_mixed/opt_out.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/nnbd_mixed/opt_out.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..a3c6fff
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd_mixed/opt_out.dart.textual_outline_modelled.expect
@@ -0,0 +1,19 @@
+import 'opt_out_lib.dart';
+List<String?> l = [];
+String? s = null;
+class A<T> {
+ ---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+ int field = 42;
+}
+class B extends A<String?> {}
+typedef F = void Function()?;
+var t = s!;
+---- unknown chunk starts ----
+late
+---- unknown chunk ends ----
+int field = 42;
+main() {}
+noErrors() {}
+void method(void f()?, {required int a}) {}
diff --git a/pkg/front_end/testcases/textual_outline.status b/pkg/front_end/testcases/textual_outline.status
index 0553975..b946481 100644
--- a/pkg/front_end/testcases/textual_outline.status
+++ b/pkg/front_end/testcases/textual_outline.status
@@ -138,7 +138,6 @@
inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr1: FormatterCrash
inference/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr1: FormatterCrash
late_lowering/covariant_late_field: FormatterCrash
-late_lowering/definitely_unassigned: FormatterCrash
late_lowering/getter_vs_setter_type: FormatterCrash
late_lowering/infer_late_field_type: FormatterCrash
late_lowering/initializer_rewrite: FormatterCrash
@@ -172,10 +171,8 @@
late_lowering/override_getter_setter: FormatterCrash
late_lowering/skip_late_final_uninitialized_instance_fields/main: FormatterCrash
late_lowering/uninitialized_non_nullable_late_fields: FormatterCrash
-late_lowering_sentinel/late_fields: FormatterCrash
nnbd/abstract_field_errors: FormatterCrash
nnbd/covariant_late_field: FormatterCrash
-nnbd/definitely_unassigned: FormatterCrash
nnbd/extension_bounds: FormatterCrash
nnbd/extension_never: FormatterCrash
nnbd/extension_type_variable_bound: FormatterCrash
@@ -195,7 +192,6 @@
nnbd/issue43278: FormatterCrash
nnbd/issue43354: FormatterCrash
nnbd/issue43591: FormatterCrash
-nnbd/issue43689: FormatterCrash
nnbd/language_issue1182: FormatterCrash
nnbd/late: FormatterCrash
nnbd/later: FormatterCrash
@@ -219,7 +215,6 @@
nnbd_mixed/no_null_shorting_extension: FormatterCrash
nnbd_mixed/null_safety_invalid_language_version: FormatterCrash
nnbd_mixed/nullable_extension_on_opt_out: FormatterCrash
-nnbd_mixed/opt_out: FormatterCrash
nnbd_mixed/unsound_checks: FormatterCrash
nonfunction_type_aliases/issue41501: FormatterCrash
rasta/bad_redirection: FormatterCrash
diff --git a/tools/VERSION b/tools/VERSION
index e263e32..468031e 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 12
PATCH 0
-PRERELEASE 136
+PRERELEASE 137
PRERELEASE_PATCH 0
\ No newline at end of file