class Meh {
Str text := "meh" {
get { &text }
set { &text = it }
}
Void main() {
meh := 69 as Obj
foo := (meh as Meh)?.&text // --> sys::NullErr
}
}
It appears that the storage operator does not take the null safe operator into account and throws a NullErr; whereas I would expect it to return null instead.
In this simple example, removing the storage operator & then returns null as expected.
SlimerDude Sat 30 Nov
I just came across this little edge case today...
It appears that the storage operator does not take the null safe operator into account and throws a
NullErr
; whereas I would expect it to returnnull
instead.In this simple example, removing the storage operator
&
then returnsnull
as expected.brian Sun 1 Dec
Thanks for reporting Steve - I pushed a fix