-
-
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
type mismatch error when use generic as typedesc in templates #20033
Comments
gabbhack
changed the title
Cant use generic as typedesc in templates
type mismatch error when use generic as typedesc in templates
Jul 15, 2022
Related: #6340 and others |
bung87
added a commit
to bung87/Nim
that referenced
this issue
Sep 20, 2022
metagn
added a commit
to metagn/Nim
that referenced
this issue
Aug 23, 2023
fixes nim-lang#13527, fixes nim-lang#17240, fixes nim-lang#6340, fixes nim-lang#20033, fixes nim-lang#19576, fixes nim-lang#19076
This was referenced Aug 23, 2023
jangko
pushed a commit
to jangko/nimPNG
that referenced
this issue
Aug 23, 2023
Below `newStorage[T]` and `newStorageOfCap[T]` call `getUnderlyingType(T)`, which shouldn't work because `T` is a type and `getUnderlyingType` takes an `openArray` argument. However it works due to a [Nim bug](nim-lang/Nim#20033) where `T` is treated as a *value* of its type. To make this work with and without the bug fixed, add an additional `getUnderlyingType` overload that takes a `type openArray` parameter instead.
metagn
added a commit
to metagn/Nim
that referenced
this issue
Aug 25, 2023
fixes nim-lang#13527, fixes nim-lang#17240, fixes nim-lang#6340, fixes nim-lang#20033, fixes nim-lang#19576, fixes nim-lang#19076
Araq
pushed a commit
that referenced
this issue
Aug 25, 2023
narimiran
pushed a commit
that referenced
this issue
Dec 1, 2023
narimiran
pushed a commit
that referenced
this issue
Dec 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example
https://play.nim-lang.org/#ix=44pk
Current Output
Expected Output
This work if use proc instead of template
Workaround
Maybe #2005 is related.
The text was updated successfully, but these errors were encountered: