Simply reporting bug: No throwing for &x1??x2 but an undefined behavor Topic is solved

Report problems with documented functionality
User avatar
V2User
Posts: 219
Joined: 30 Apr 2021, 04:04

Simply reporting bug: No throwing for &x1??x2 but an undefined behavor

02 Aug 2023, 02:29

Simply report a small bug without clear purposes. The behavior of c:=&x1??x2 is not defined nor throwing.
Code:

Code: Select all

x3:=5
x2:=&x3
c:=&x1??x2
OutputDebug(%c%) ;perhaps expect 5 but got x1's value.
image.png
image.png (46.26 KiB) Viewed 1018 times
Descolada
Posts: 1431
Joined: 23 Dec 2021, 02:30

Re: Simply reporting bug: No throwing for &x1??x2 but an undefined behavor

02 Aug 2023, 03:49

I would expect &x1 to return a VarRef pointing to an unset variable (x1), and since VarRef is not an unset then c:=&x1??x2 evaluates to c:=&x1. Not a bug IMO.
lexikos
Posts: 9780
Joined: 30 Sep 2013, 04:07
Contact:

Re: Simply reporting bug: No throwing for &x1??x2 but an undefined behavor

03 Aug 2023, 01:55

The reference operator has higher precedence. This should probably raise a syntax error (not throw) as the reference operator cannot ever produce unset, but the current version is very limited in how the ? and ?? operators can be used or validated.
lexikos
Posts: 9780
Joined: 30 Sep 2013, 04:07
Contact:

Re: Simply reporting bug: No throwing for &x1??x2 but an undefined behavor  Topic is solved

15 Aug 2023, 05:47

This causes a load-time error in v2.1-alpha.2, as intended.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 33 guests