284296f862
Not fixed for nullable record types in https://dart-review.googlesource.com/c/sdk/+/280106. Fixes: https://dartbug.com/52439 Closes: https://dartbug.com/52462 Change-Id: I52f42406f2e1c6b7c874a9828ef7f1de397b3c83 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304642 Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
27 lines
503 B
Dart
27 lines
503 B
Dart
class Class {
|
|
dynamic field;
|
|
Class(this.field);
|
|
}
|
|
|
|
test(a) {
|
|
switch (a) {
|
|
case (foo: int b) when b != 2:
|
|
print(b);
|
|
case (foo: (int, int) b) when b != (2, 3):
|
|
print(b);
|
|
case Class(field: int b) when b != 2:
|
|
print(b);
|
|
case Class(field: (int, int) b) when b != (2, 3):
|
|
print(b);
|
|
}
|
|
}
|
|
|
|
testNullable(a) {
|
|
switch (a) {
|
|
case (foo: (int, int)? b) when b != (2, 3):
|
|
print(b);
|
|
case Class(field: (int, int)? b) when b != (2, 3):
|
|
print(b);
|
|
}
|
|
}
|