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

Test for union type using a concrete instance of Union and scope union() template output #52

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

alaviss
Copy link
Owner

@alaviss alaviss commented Sep 5, 2023

Contains fix for #51 and a generic issue that was not reported

Previously we performed tests against Union symbol itself to check
for inheritance.

This relied on an implementation detail where an instance of a generic
in the AST uses the same symbol as the generic type.

The PR nim-lang/Nim#22642 changed this
implementation detail. So now, we have to account for both cases of new
and old compilers by also testing against a pre-defined instance.

Fixes #51
In generic object context, the bare `type TImpl = T` statement
might be evaluated multiple times after gensym.

This causes `TImpl`gensymN` to be redefined multiple times,
breaking compilation.

Adding a block scope seems to solve the problem.
@alaviss alaviss changed the title Fixes for 0.1.5 Test for union type using a concrete instance of Union and scope union() template output Sep 5, 2023
@alaviss alaviss merged commit 79e3f8a into main Sep 5, 2023
4 checks passed
@alaviss alaviss deleted the fix/issue-51 branch September 5, 2023 22:30
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.

1 participant