-
Notifications
You must be signed in to change notification settings - Fork 2
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
Generic instantiation change breaks recCase
#51
Comments
recCase
Nim change will probably be reverted Tested |
reverts nim-lang#22642, reopens nim-lang#22639, closes nim-lang#22646, refs nim-lang#22640, refs alaviss/union#51
Looks like my little hack to see if I think I have a solution for this, though. |
Previously we performed tests against Union symbol itself to check for inheritance. This relied on an implementation detail where an instance of a generic has the same type as the generic type itself. Recent changes in the compiler shows that we cannot rely on this. Thus the module now opt for inheriting from and testing against a pre-defined instance of Union. Ref nim-lang/Nim#22642 Fixes #51
Apparently I misremembered how this is done. As described in nim-lang/Nim#22642, old Nim uses the generic type symbol for AST, which is why I had to check directly against the generic symbol. |
This would have also been a problem with nim-lang/Nim#22655, thanks for fixing |
With nim-lang/Nim#22642 this:
becomes:
Tests now error. The error is:
Error points to this:
union/union/uniontraits.nim
Lines 104 to 106 in a5b6d31
An example of where the error occurs (first usage of
as
):union/tests/treadme.nim
Lines 6 to 15 in a5b6d31
The PR added getObjectSym:
I'm guessing this usage of
sameType
needs to be updated:union/union/uniontraits.nim
Lines 88 to 94 in a5b6d31
But I don't know how.
The text was updated successfully, but these errors were encountered: