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

Add compile-time symbol for genericsOpenSym #23385

Closed
arnetheduck opened this issue Mar 10, 2024 · 1 comment · Fixed by #23892
Closed

Add compile-time symbol for genericsOpenSym #23385

arnetheduck opened this issue Mar 10, 2024 · 1 comment · Fixed by #23892

Comments

@arnetheduck
Copy link
Contributor

Summary

Add a nimGenericsOpenSym injected define when genericsOpenSym is enabled

Description

This is needed to write code that reacts to the experimental feature being enabled, in when expressions so that it can use workarounds when the feature is not enabled.

Alternatives

No response

Examples

No response

Backwards Compatibility

No response

Links

No response

@arnetheduck
Copy link
Contributor Author

Also add a nimHasGenericsOpenSym for nim versions that support the experimental - this allows libraries to detect when it's supported and not enabled (to prompt users to enable it)

@Araq Araq added the Status label Mar 14, 2024
metagn added a commit to metagn/Nim that referenced this issue May 4, 2024
@Araq Araq closed this as completed in 0c890ff Aug 12, 2024
narimiran pushed a commit that referenced this issue Aug 14, 2024
refs #23873 (comment),
fixes #23386, fixes #23385, supersedes #23572

Turns the `nfOpenSym` node flag implemented in #23091 and extended in
containing either `nkSym` or `nkOpenSymChoice`. Since this affects
macros working on generic proc AST, the node kind is now only generated
when the experimental switch `genericsOpenSym` is enabled, and a new
node flag `nfDisabledOpenSym` is set to the `nkSym` or `nkOpenSymChoice`
when the switch is not enabled so that we can give a warning.

Now that the experimental switch has more reasonable semantics, we
define `nimHasGenericsOpenSym2`.

(cherry picked from commit 0c890ff)
narimiran pushed a commit that referenced this issue Aug 14, 2024
refs #23873 (comment),
fixes #23386, fixes #23385, supersedes #23572

Turns the `nfOpenSym` node flag implemented in #23091 and extended in
containing either `nkSym` or `nkOpenSymChoice`. Since this affects
macros working on generic proc AST, the node kind is now only generated
when the experimental switch `genericsOpenSym` is enabled, and a new
node flag `nfDisabledOpenSym` is set to the `nkSym` or `nkOpenSymChoice`
when the switch is not enabled so that we can give a warning.

Now that the experimental switch has more reasonable semantics, we
define `nimHasGenericsOpenSym2`.

(cherry picked from commit 0c890ff)
narimiran pushed a commit that referenced this issue Aug 14, 2024
refs #23873 (comment),
fixes #23386, fixes #23385, supersedes #23572

Turns the `nfOpenSym` node flag implemented in #23091 and extended in
containing either `nkSym` or `nkOpenSymChoice`. Since this affects
macros working on generic proc AST, the node kind is now only generated
when the experimental switch `genericsOpenSym` is enabled, and a new
node flag `nfDisabledOpenSym` is set to the `nkSym` or `nkOpenSymChoice`
when the switch is not enabled so that we can give a warning.

Now that the experimental switch has more reasonable semantics, we
define `nimHasGenericsOpenSym2`.

(cherry picked from commit 0c890ff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants