SpaceManiac / SpacemanDMM

A BYOND language smartness provider, map renderer, and more.
https://marketplace.visualstudio.com/items?itemName=platymuus.dm-langclient
GNU General Public License v3.0
83 stars 83 forks source link

`/proc/thing() as /datum/whatever` syntax should be used when SpacemanDMM_return_type is not set #406

Closed Absolucy closed 3 months ago

Absolucy commented 3 months ago

Currently, I have to do stuff like this to get the langserver to not complain, even tho the DM compiler is just fine with this:

/**
 * Proc that will return the team this antagonist belongs to, when called. Helpful with antagonists that may belong to multiple potential teams in a single round.
 */
/datum/antagonist/proc/get_team() as /datum/team
    RETURN_TYPE(/datum/team) // it's right there, dreamchecker, come on
    return

Without the return type, things like get_team()?.remove_member(owner) will result in proc call requires static type: "remove_member", even tho the return type is specified by the DM syntax, and compiles+runs just fine with the actual compiler.