diff options
author | metagn <metagngn@gmail.com> | 2023-12-18 19:40:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-18 17:40:30 +0100 |
commit | 941659581add605e8a4ddfc9ff00662aa6234d26 (patch) | |
tree | a8c2eb00bdddbff13aef0c4ac7c43915908e192a /lib/std/private/syslocks.nim | |
parent | 080a0723369bbfc2f4bdc1aaa2b0717d467b84aa (diff) | |
download | Nim-941659581add605e8a4ddfc9ff00662aa6234d26.tar.gz |
allow replacing captured syms in macro calls in generics (#23091)
fixes #22605, separated from #22744 This marks symbol captures in macro calls in generic contexts as `nfOpenSym`, which means if there is a new symbol in the local instantiatied body during instantiation time, this symbol replaces the captured symbol. We have to be careful not to consider symbols outside of the instantiation body during instantiation, because this will leak symbols from the instantiation context scope rather than the original declaration scope. This is done by checking if the local context owner (maybe should be the symbol of the proc currently getting instantiated instead? not sure how to get this) is the same as or a parent owner of the owner of the replacement candidate symbol. This solution is distinct from the symchoice mechanisms which we originally assumed had to be related, if this assumption was wrong it would explain why this solution took so long to arrive at.
Diffstat (limited to 'lib/std/private/syslocks.nim')
0 files changed, 0 insertions, 0 deletions