[MIRROR] OpenDream TypeMaker Prep #2301
Merged
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.
Mirrored on Nova: NovaSector/NovaSector#1292
Original PR: tgstation/tgstation#81830
About The Pull Request
OpenDream is adding support for proc and var typechecking using
as
in OpenDreamProject/OpenDream#1705BYOND silently ignores most uses of
as
, but OpenDream can leverage it for static typing.E.g. the following code will error in OpenDream while doing nothing in BYOND:
Warning OD2701 at code.dm:29:8: /datum/foobar/meep(): Invalid return type "num", expected "text"
Pragmas allow these type emissions to be warnings, errors, or suppressed entirely.
This PR modifies some existing uses of
as
in TG to preventImplicitNullType
warnings (which is when a var with a null value doesn't explicitly have the|null
type specified). This specific pragma is a bit opinionated so it could simply be disabled, but since this has no impact on BYOND behavior I don't see a reason not to fix these examples anyways.Why It's Good For The Game
Typechecking.
Changelog
no cl no fun