mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:01:20 +00:00
[cfe] Build PatternVariableDeclaration in BodyBuilder
Change-Id: Ic55dbc03bf2cf4865275b186266c0f420263d406 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273744 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Jens Johansen <jensj@google.com>
This commit is contained in:
parent
e44cece2ca
commit
e6d59342ff
|
@ -8490,6 +8490,27 @@ class BodyBuilder extends StackListenerImpl
|
||||||
push(pattern);
|
push(pattern);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void handlePatternVariableDeclarationStatement(
|
||||||
|
Token keyword, Token equals, Token semicolon) {
|
||||||
|
debugEvent('PatternVariableDeclarationStatement');
|
||||||
|
assert(checkState(keyword, [
|
||||||
|
unionOfKinds([
|
||||||
|
ValueKinds.Expression,
|
||||||
|
ValueKinds.Generator,
|
||||||
|
ValueKinds.ProblemBuilder,
|
||||||
|
]),
|
||||||
|
ValueKinds.Pattern,
|
||||||
|
ValueKinds.AnnotationListOrNull,
|
||||||
|
]));
|
||||||
|
Expression initializer = popForValue();
|
||||||
|
Pattern pattern = toPattern(pop());
|
||||||
|
// TODO(johnniwinther,cstefantsova): Handle metadata.
|
||||||
|
pop(NullValue.Metadata) as List<Expression>?;
|
||||||
|
push(new PatternVariableDeclaration(pattern, initializer,
|
||||||
|
offset: keyword.charOffset, isFinal: keyword.lexeme == 'final'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class EnsureLoaded {
|
abstract class EnsureLoaded {
|
||||||
|
|
|
@ -4742,38 +4742,29 @@ class WildcardPattern extends Pattern {
|
||||||
class PatternVariableDeclaration extends InternalStatement {
|
class PatternVariableDeclaration extends InternalStatement {
|
||||||
final Pattern pattern;
|
final Pattern pattern;
|
||||||
final Expression initializer;
|
final Expression initializer;
|
||||||
|
final bool isFinal;
|
||||||
|
|
||||||
PatternVariableDeclaration(this.pattern, this.initializer,
|
PatternVariableDeclaration(this.pattern, this.initializer,
|
||||||
{required int offset}) {
|
{required int offset, required this.isFinal}) {
|
||||||
fileOffset = offset;
|
fileOffset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
StatementInferenceResult acceptInference(InferenceVisitorImpl visitor) {
|
StatementInferenceResult acceptInference(InferenceVisitorImpl visitor) {
|
||||||
throw new UnimplementedError("PatternVariableDeclaration.acceptInference");
|
return visitor.visitPatternVariableDeclaration(this);
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
R accept<R>(StatementVisitor<R> visitor) {
|
|
||||||
if (visitor is Printer || visitor is Precedence || visitor is Transformer) {
|
|
||||||
// Allow visitors needed for toString and replaceWith.
|
|
||||||
return visitor.defaultStatement(this);
|
|
||||||
}
|
|
||||||
return unsupported(
|
|
||||||
"${runtimeType}.accept on ${visitor.runtimeType}", -1, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
R accept1<R, A>(StatementVisitor1<R, A> visitor, A arg) {
|
|
||||||
return unsupported(
|
|
||||||
"${runtimeType}.accept1 on ${visitor.runtimeType}", -1, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void toTextInternal(AstPrinter printer) {
|
void toTextInternal(AstPrinter printer) {
|
||||||
|
if (isFinal) {
|
||||||
|
printer.write('final ');
|
||||||
|
} else {
|
||||||
|
printer.write('var ');
|
||||||
|
}
|
||||||
pattern.toTextInternal(printer);
|
pattern.toTextInternal(printer);
|
||||||
printer.write(" = ");
|
printer.write(" = ");
|
||||||
printer.writeExpression(initializer);
|
printer.writeExpression(initializer);
|
||||||
|
printer.write(';');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -8103,6 +8103,12 @@ class InferenceVisitorImpl extends InferenceVisitorBase
|
||||||
return const StatementInferenceResult();
|
return const StatementInferenceResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatementInferenceResult visitPatternVariableDeclaration(
|
||||||
|
PatternVariableDeclaration node) {
|
||||||
|
return new StatementInferenceResult.single(
|
||||||
|
new ExpressionStatement(new InvalidExpression('$node')));
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ExpressionInferenceResult visitVariableGet(
|
ExpressionInferenceResult visitVariableGet(
|
||||||
covariant VariableGetImpl node, DartType typeContext) {
|
covariant VariableGetImpl node, DartType typeContext) {
|
||||||
|
|
|
@ -129,6 +129,7 @@ void main() {
|
||||||
_testIfCaseStatement();
|
_testIfCaseStatement();
|
||||||
_testPatternSwitchStatement();
|
_testPatternSwitchStatement();
|
||||||
_testSwitchExpression();
|
_testSwitchExpression();
|
||||||
|
_testPatternVariableDeclaration();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1312,3 +1313,19 @@ if (0 case 1 when 2) return;''');
|
||||||
'''
|
'''
|
||||||
if (0 case 1 when 2) return 3; else return 4;''');
|
if (0 case 1 when 2) return 3; else return 4;''');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _testPatternVariableDeclaration() {
|
||||||
|
testStatement(
|
||||||
|
new PatternVariableDeclaration(
|
||||||
|
new ExpressionPattern(new IntLiteral(0)), new IntLiteral(1),
|
||||||
|
isFinal: false, offset: TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
var 0 = 1;''');
|
||||||
|
|
||||||
|
testStatement(
|
||||||
|
new PatternVariableDeclaration(
|
||||||
|
new ExpressionPattern(new IntLiteral(0)), new IntLiteral(1),
|
||||||
|
isFinal: true, offset: TreeNode.noOffset),
|
||||||
|
'''
|
||||||
|
final 0 = 1;''');
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
late var (_) = x;
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
//
|
||||||
|
// Problems in library:
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected an identifier, but got '('.
|
||||||
|
// Try inserting an identifier before '('.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Undefined name '_'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Expected an identifier, but got ')'.
|
||||||
|
// Try inserting an identifier before ')'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Unexpected token ';'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:16: Error: Expected an identifier, but got '='.
|
||||||
|
// Try inserting an identifier before '='.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {}
|
|
@ -0,0 +1,38 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
//
|
||||||
|
// Problems in library:
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected an identifier, but got '('.
|
||||||
|
// Try inserting an identifier before '('.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Undefined name '_'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Expected an identifier, but got ')'.
|
||||||
|
// Try inserting an identifier before ')'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Unexpected token ';'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:16: Error: Expected an identifier, but got '='.
|
||||||
|
// Try inserting an identifier before '='.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,38 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
//
|
||||||
|
// Problems in library:
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected an identifier, but got '('.
|
||||||
|
// Try inserting an identifier before '('.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Undefined name '_'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Expected an identifier, but got ')'.
|
||||||
|
// Try inserting an identifier before ')'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Unexpected token ';'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:16: Error: Expected an identifier, but got '='.
|
||||||
|
// Try inserting an identifier before '='.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {}
|
|
@ -0,0 +1,38 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
//
|
||||||
|
// Problems in library:
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected an identifier, but got '('.
|
||||||
|
// Try inserting an identifier before '('.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Undefined name '_'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Expected an identifier, but got ')'.
|
||||||
|
// Try inserting an identifier before ')'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Unexpected token ';'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:16: Error: Expected an identifier, but got '='.
|
||||||
|
// Try inserting an identifier before '='.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {}
|
|
@ -0,0 +1,5 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,38 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
//
|
||||||
|
// Problems in library:
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected an identifier, but got '('.
|
||||||
|
// Try inserting an identifier before '('.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:12: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Expected ';' after this.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:13: Error: Undefined name '_'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Expected an identifier, but got ')'.
|
||||||
|
// Try inserting an identifier before ')'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:14: Error: Unexpected token ';'.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
// pkg/front_end/testcases/patterns/patternVariableDeclarationStatement_disallowsLate.dart:6:16: Error: Expected an identifier, but got '='.
|
||||||
|
// Try inserting an identifier before '='.
|
||||||
|
// late var (_) = x;
|
||||||
|
// ^
|
||||||
|
//
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {}
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
final C(f: a) = x;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
var C(f: a) = x;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <dummy-pattern> = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
var [a] = x;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
var {'a': a} = x;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var {\"a\": var a} = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var {\"a\": var a} = x;)";
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var {\"a\": var a} = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var {\"a\": var a} = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var {\"a\": var a} = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
var (a) = x;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var var a = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var var a = x;)";
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var var a = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var var a = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var var a = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
var (a,) = x;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var (var a) = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var (var a) = x;)";
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1 @@
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var (var a) = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var (var a) = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,6 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(var (var a) = x;)";
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
const annotation = 0;
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
@annotation
|
||||||
|
final C(f: a) = x;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = 0;
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <dummy-pattern> = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
const annotation = 0;
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
@annotation
|
||||||
|
final [a] = x;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = 0;
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final <<implicit-type-argument>>[var a] = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
const annotation = 0;
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
@annotation
|
||||||
|
final {'a': a} = x;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final {\"a\": var a} = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final {\"a\": var a} = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final {\"a\": var a} = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final {\"a\": var a} = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = 0;
|
||||||
|
static method f(dynamic x) → dynamic
|
||||||
|
;
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final {\"a\": var a} = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
|
||||||
|
// for details. All rights reserved. Use of this source code is governed by a
|
||||||
|
// BSD-style license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
const annotation = 0;
|
||||||
|
|
||||||
|
f(x) {
|
||||||
|
@annotation
|
||||||
|
final (a) = x;
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final var a = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final var a = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,2 @@
|
||||||
|
const annotation = 0;
|
||||||
|
f(x) {}
|
|
@ -0,0 +1,12 @@
|
||||||
|
library /*isNonNullableByDefault*/;
|
||||||
|
import self as self;
|
||||||
|
import "dart:core" as core;
|
||||||
|
|
||||||
|
static const field core::int annotation = #C1;
|
||||||
|
static method f(dynamic x) → dynamic {
|
||||||
|
invalid-expression "PatternVariableDeclaration(final var a = x;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
constants {
|
||||||
|
#C1 = 0
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue