Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly gensym shim templates in p_accessors #642

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

metagn
Copy link
Contributor

@metagn metagn commented Mar 25, 2024

For code like:

when foo():
  let data = ...
else:
  template data: untyped = ...

in a template, since the let data is automatically gensym'd, the template data must also be marked as gensym, since routines are injected by default in templates. Due to a bug in the Nim compiler (nim-lang/Nim#23326) the template data here was forced to being gensym due to the previous let data symbol. This behavior might not change, but the template data can be marked as gensym anyway for clarity.

For code like:

```nim
when foo():
  let data = ...
else:
  template data: untyped = ...
```

in a template, since the `let data` is automatically gensym'd, the `template data` must also be marked as `gensym`, since routines are injected by default in templates. Due to a bug in the Nim compiler (nim-lang/Nim#23326) the `template data` here was forced to being gensym due to the previous `let data` symbol. This behavior might not change, but the `template data` can be marked as gensym anyway for clarity.
@Vindaar Vindaar merged commit 2ff2431 into mratsim:master Mar 26, 2024
6 checks passed
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.

2 participants