ID:2724218
 
Resolved
Implied types for new() and locate() can be used alongside all assignment operators now, not just the = operator. Therefore, A ||= new is a perfectly valid statement if A has a defined type.
Applies to:DM Language
BYOND Version:514
Operating System:Windows 10 Pro 64-bit
Web Browser:Chrome 94.0.4606.71
Status: Resolved (514.1569)

This issue has been resolved.
Descriptive Problem Summary:

It seems the ||= operator is failing to work when used as "||= new()", it gives the old "error: new: implicit type may only be used in an assignment. (The revised syntax for new(Type,...) is new Type(...).)"

Numbered Steps to Reproduce Problem:

Just create a typed obj variable and run a ||= new() on it. Compile and you will get the error, duh.

Code Snippet (if applicable) to Reproduce Problem:
var/obj/test
world/New()
test ||= new()


Expected Results:

Well to not get an error..

Actual Results:

An incorrect error code.

Does the problem occur:
Every time? Or how often? Every time.
In other games? All codes.
In other user accounts? No account needed
On other computers? Yes.

When does the problem NOT occur? Never.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

I believe it has been an issue for a few patches.

Workarounds:

Just doing ||= new type()..
Lummox JR resolved issue with message:
Implied types for new() and locate() can be used alongside all assignment operators now, not just the = operator. Therefore, A ||= new is a perfectly valid statement if A has a defined type.
In response to Lummox JR
Wow! Thank you, for the hasty resolution!