Files
sdk/pkg/front_end/testcases/patterns/pattern_assignment_declares.dart
Johnni Winther 3448fbc93c [cfe] Report error on variable declaration in pattern assignment
Change-Id: I5d9f06309f915460dfc9fe9549b6e7d5c814ef3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280261
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-03 00:32:15 +00:00

16 lines
408 B
Dart

// Copyright (c) 2023, 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.
class Class {
dynamic field1;
dynamic field2;
}
method(x, y, z) {
var a;
(a, int b, final int c) = x;
[a, final d] = y;
Class(field1: a, field2: [[var e, _], [1, var f]]) = z;
}