elect
10/22/2020, 11:04 AMwhen
and the possibility to declare some val
quite limiting:
val platform = when(val os = DefaultNativePlatform.getCurrentOperatingSystem()) {
os.isWindows -> 0
}
if I declare something like that, when
expect exclusively matches against os
Type
I'd like something more broadMarc Knaup
10/22/2020, 11:07 AM==
or treat it as a boolean?
That’s probably a general problem with when
. Some use ==
(and support partial is …
) while some expect a boolean value.elect
10/22/2020, 11:11 AM==
if type matches, boolean otherwiseelect
10/22/2020, 11:11 AMMarc Knaup
10/22/2020, 11:14 AMAny
as an example. Can be ==
checked against everything.elect
10/22/2020, 11:32 AM