You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This works correctlydeff1(s: String|Null):String=if(s ==null) "other"else s
// This fails to compiledeff(s: String|Null):String= s match {
casenull=>"other"case s => s
}
Output
case s => s
^Found: (s : String|Null)
Required:String
Expectation
My expectation is that what happens with def f(s: String | Null): String = if(s == null) "other" else s should apply to pattern matching too.
I couldn't find any open issue treating this, so I opened one.