Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ProcArgumentGlobal, InvalidIndexOperation and AmbiguousInOrder
New Pragma: OD2211 - ProcArgumentGlobal from warning to error
A new pragma has been added for detecting this BYOND bug: https://www.byond.com/forum/post/2830750
When a proc argument begins with /var/ instead of var/, it creates a global variable instead of an argument.
/datum/proc/foo(/var/bar = 5)
return
/proc/main()
world.log << global.bar // This prints 5 in BYOND
Since this is obviously nonsense, elevating this pragma to an error is strongly encouraged. I have only found it in one SS13 codebase so far.
New Pragma: OD2304 - InvalidIndexOperation from warning to error
As of BYOND 515.1641, indexing datums (without an explicit operator[] overload) is now a runtime error in BYOND.
This new pragma detects such cases at compiletime, and elevating it to an error is strongly encouraged as previously-valid code that exists in SS13 will now runtime. It's a warning by default to maintain compatibility with older code & BYOND versions.
Example:
var/datum/foo = new
world.log << foo["bar"] // OD2304, Invalid index operation. datum[] index operations are not valid starting in BYOND 515.1641
New Pragma: OD3204 - AmbiguousInOrder from warning to error
A new pragma has been added for detecting ambiguous uses of in with unexpected behavior, similar to the lint in SpacemanDMM/DreamChecker. An example is "a" in a || "b" in b being parsed as ("a" in (a || "b")) in b. This is more comprehensive than SDMM's lint, and elevating this pragma to an error is strongly encouraged to detect logic errors.