Brian Donovan
09/15/2021, 6:43 PMJoffrey
09/15/2021, 6:44 PMis
. You're getting this because the when
is trying to compare expression values, it's not checking against types. So it's trying to get you to create a value of type Resources.Success
by calling its constructorBrian Donovan
09/15/2021, 6:44 PMJoffrey
09/15/2021, 6:47 PMwhen
branches can either check types or check values. You use is
when you want to test whether the subject inside the when
"is" of a certain type. If you don't use is
, you're checking if the subject of the when
is equal to the value in the branch.Joffrey
09/15/2021, 6:48 PMobject
(probably the case of Resource.Loading
), then an is
check is kinda the same as a value check, because there is only one value of this typeBrian Donovan
09/15/2021, 6:49 PM