-
-
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
issues using generic parameters in template #6340
Labels
Comments
Right. I have been using workarounds like this: type
A[T] = object
v: T
proc foo(x: int) = echo "int"
proc foo(x: typedesc[int]) = echo "typedesc[int]"
template fooT(x: int) = echo "int"
template fooT(x: typedesc[int]) = echo "typedesc[int]"
proc foo(x: A) =
foo(x.T)
fooT(x.T)
template fooT(x: A) =
foo(x.T)
fooT(x.T)
var x: A[int]
foo(x)
fooT(x) |
Still crashes with #head, full stacktrace below.
|
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
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
In
template fooT[T](x: A[T])
callingfoo(T)
, which is a proc, crashes the compiler and callingfooT(T)
, which is a template, matches theint
overload instead oftypedesc[int]
.The text was updated successfully, but these errors were encountered: