-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Cannot infer the value of static param #10220
Comments
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions. |
This doesn't trigger crash anymore.
This doesn't crash, but it produces:
|
The compiler, I think rightfully, can't infer the Giving |
fixes #24415 Since #23978 (which is in 2.0), all generic types that alias to another type now insert a `tyAlias` layer in their value. However the `skipGenericAlias` etc code which `sigmatch` uses is not updated for this, so `tyAlias` is now skipped in these. The relevant code in sigmatch is: https://github.com/nim-lang/Nim/blob/67ad1ae1598b08039c971812dc172dd48624b7b0/compiler/sigmatch.nim#L1668-L1673 This behavior is also suspicious IMO, not skipping a structural `tyGenericInst` alias can be useful for code like #10220, but this is currently arbitrarily decided based on "depth" and whether the alias is to another `tyGenericInst` type or not. Maybe in the future we could enforce the use of a nominal type.
Sorry for the long repro code, it's quite tricky to extract it from my codebase and keep the issue reproducible as 3 differents procs/statements need to be present
This is a follow-up on my Go playing bot project which triggered many bugs last April every time I tried to avoid one:
$
string conversion not matching #7611 (Static[non-int] +$
string conversion not matching)strformat
doesn't work properly inside generics #7632 (strformat
doesn't work properly inside generics and templates)With this new example I get:
The text was updated successfully, but these errors were encountered: