ID:2376366
 
BYOND Version:512.1427
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Firefox 60.0
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
An empty var declaration causes the following parenthesized ternary to fail compilation even if it's on another line entirely.

"error: ?: bad variable definition"

Numbered Steps to Reproduce Problem:
The first code snippet will fail compilation with the above error, the second passes normally.

Code Snippet (if applicable) to Reproduce Problem:
/proc/say(thing)
usr << thing

/mob/verb/nulless()
var/foo

( name ? say("Hi") : say("???") )
return foo

/proc/say(thing)
usr << thing

/mob/verb/nulless()
var/foo = null

( name ? say("Hi") : say("???") )
return foo


Expected Results:
Expected it to make no difference between
var/foo

and
var/foo = null


Actual Results:
It seems the compiler expects = to follow to some extent or treats parentheses differently.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked?
It is an issue in 511.1385 as well

Workarounds:
Just use var/foo = null, it shouldn't make a difference.