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
a := {123:IsObject, 222:{__item:42}}
assert (a?.123) ?? 0 = IsObject
; this?.1 can be member access, but in this case is ternary,; because a?.123() is always member access:
assert (this?.1&& a?.123() : 0) ?? 0
assert ((this?.1&& a?.222[] : 0) ?? 0) = 42
f() => 42
assert f.%unset%() = 42
assert f.%a?%() = 42
a := 'Bind'
assert f.%a?%() is BoundFunc
assert(c) => c ; (Not the actual definition)
This is taken from some test units. With v2.4.6, there are some incorrect "Missing ':'" diagnostics:
(a?.123). This should be interpreted as member access like a.123, because it can't be ternary. I think the exact rule isn't documented, but basically it just tries to make the new syntax work without breaking any scripts (so ternary takes precedence).
this?.1. The comment explains, but I forget how it actually works, so feel free to ignore these two.
f.%a?%. This just allows a to be unset; "unset resolves to the default property (either __Item or Call)."
I think that it would be safe for the extension to assume ?. is member access if the colon is missing, although the actual interpretation might differ in some complicated cases.
The text was updated successfully, but these errors were encountered:
This is taken from some test units. With v2.4.6, there are some incorrect "Missing ':'" diagnostics:
(a?.123)
. This should be interpreted as member access likea.123
, because it can't be ternary. I think the exact rule isn't documented, but basically it just tries to make the new syntax work without breaking any scripts (so ternary takes precedence).this?.1
. The comment explains, but I forget how it actually works, so feel free to ignore these two.f.%a?%
. This just allowsa
to be unset; "unset resolves to the default property (either __Item or Call)."I think that it would be safe for the extension to assume
?.
is member access if the colon is missing, although the actual interpretation might differ in some complicated cases.The text was updated successfully, but these errors were encountered: