A more approachable thing to do is allow variable definitions in switch statements:switch (auto x = fun() { ... }It is surprising that doesn't work, which is a good argument in favor of the feature (removal of an undue limitation, rule of least astonishment etc).
https://issues.dlang.org/show_bug.cgi?id=11070 lol
