f8307ed296
Fixes #50826 Change-Id: I5e71c4dd0e4f937c4570e4851cd4c1e3446d888a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277003 Commit-Queue: Chloe Stefantsova <cstefantsova@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
17 lines
402 B
Dart
17 lines
402 B
Dart
// 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.
|
|
|
|
class A {
|
|
String get foo => "foo";
|
|
Object? get bar => null;
|
|
}
|
|
|
|
test(dynamic x) {
|
|
if (x case A(foo: "", bar: String y as String)) {
|
|
return y;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|