Skip to content

emit error when proc is defined multiple times#181

Merged
spookydonut merged 4 commits intoSpaceManiac:masterfrom
sohpeach:proc_redef
May 8, 2020
Merged

emit error when proc is defined multiple times#181
spookydonut merged 4 commits intoSpaceManiac:masterfrom
sohpeach:proc_redef

Conversation

@sohpeach
Copy link
Copy Markdown
Contributor

@sohpeach sohpeach commented May 2, 2020

#179 related.

Here's the code I used for tgstation/tgstation#50812. A lot of errors for this still trigger in the TG codebase.

This is pretty much the only Rust I have ever written so you'll want to give it a careful look. The duplicate var definitions stuff I wrote is still messy so that's not here yet.

The test examples pretty much show what it does:

Code that works

/mob/proc/test()
    set SpacemanDMM_can_be_redefined = 1
    return

/mob/test()
    return

Code that errors

/mob/proc/test()
    return

/mob/test()
    return
<file>, line 4, column 10:
error: redefining proc /mob/test
- 1:15: previous definition is here

@spookydonut spookydonut merged commit 36313f0 into SpaceManiac:master May 8, 2020
@SpaceManiac SpaceManiac added this to the suite v1.5 milestone Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants