blob: 13a9ff7357221e21b440fbe46de4c48f93787865 [file] [log] [blame]
import 'dart:math' as math;
class Circle {
Circle(this.radius);
final double radius;
}
dynamic Function(dynamic)? captured;
expectEquals(x, y) {}
main() {}
test1(dynamic x) => switch (x) {
Circle(radius: var r) when r > 0 => r * r * math.pi,
_ => null
};
test2(dynamic x) => switch (x) {
[int a, int b]
when (captured = (x) {
return a + b;
}) is dynamic =>
captured!(a = b),
[String a, String b]
when (captured = (x) {
return a + b;
}) is dynamic =>
captured!(a = b),
_ => null
};
test3(dynamic x) {}