Something like (with "variable declaration in when...
# language-proposals
d
Something like (with "variable declaration in when subject" as a not-implemented yet secret sauce):
Copy code
when (val str = ...) {
  "foo" -> foo()
  if str.contains("bar") -> bar()
  if "baz" in str -> baz()
}
👍 1
v
What is that
if
doing up there?
d
disregard it; it's somewhat ambiguous with
if
expression
simpleWhenExpression "if" expression
or probably better
simpleWhenExpression "where" expression