Fixes for language/patterns/ tests.

Change-Id: I3c7babafd5d9ee9d41069c6e7d04e813709b1a70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278884
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2023-01-11 20:49:28 +00:00 committed by Commit Queue
parent eaba8086db
commit 473b5f80b1
3 changed files with 7 additions and 7 deletions

View file

@ -2,7 +2,7 @@
// 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.
// SharedOptions=--enable-experiment=patterns
// SharedOptions=--enable-experiment=patterns,records
import "package:expect/expect.dart";

View file

@ -2,7 +2,7 @@
// 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.
// SharedOptions=--enable-experiment=patterns
// SharedOptions=--enable-experiment=patterns,records
import "package:expect/expect.dart";
@ -28,7 +28,7 @@ main() {
Expect.equals('0: 0: list', sharedDifferentContext([0, true]));
Expect.equals('1: 1: map', sharedDifferentContext({'a': 1, 'b': true}));
Expect.equals('2: 2: record', sharedDifferentContext((a: 2, b: true));
Expect.equals('2: 2: record', sharedDifferentContext((a: 2, b: true)));
Expect.equals('3: 3: nested', sharedDifferentContext((a: 3, b: [true])));
}

View file

@ -2,7 +2,7 @@
// 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.
// SharedOptions=--enable-experiment=patterns
// SharedOptions=--enable-experiment=patterns,records
import "package:expect/expect.dart";
@ -41,7 +41,7 @@ void unsharedPatternVariableShadows() {
var local = 'local';
switch (('pat', 'tern')) {
case (int topLevel, int local):
case (String topLevel, String local):
Expect.equals('pat tern', '$topLevel $local');
// Assign to pattern variable.
@ -59,8 +59,8 @@ void sharedPatternVariableShadows(Object value) {
var local = 'local';
switch (('pat', 'tern')) {
case (int topLevel, int local) when value == 0:
case (int topLevel, int local) when value == 1:
case (String topLevel, String local) when value == 0:
case (String topLevel, String local) when value == 1:
Expect.equals('pat tern', '$topLevel $local');
// Assign to pattern variable.