fixes #18235 - proc annotation type macro sym leak (#18249)

* fixes #18235 - proc annotation type macro sym leak

- also fixed a typo
- proc annotations guard symbol exports with shadow scopes
- symbol handling is shadow scope aware

* test for exporting an existing unexported sym

this one is for my homie alaviss.

* Special handling not needed in semProcAnnotation

* Testcasing

* [skip ci]  clean-up and add some more comments

* [skip ci] rm trailing whitespace

Co-authored-by: Clyybber <darkmine956@gmail.com>
This commit is contained in:
Saem Ghani 2021-06-14 00:21:33 -07:00 • committed by GitHub
commit 488acd9d07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 86 additions and 9 deletions

18
tests/macros/t18235.nim Normal file
View file

@ -0,0 +1,18 @@
import m18235
# this must error out because it was never actually exported
doAssert(not declared(foo))
doAssert not compiles(foo())
doAssert(not declared(foooof))
doAssert not compiles(foooof())
doAssert(not declared(oof))
doAssert not compiles(oof())
# this should have been exported just fine
bar()
barrab()
rab()
baz()