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

Implicitly generic procs don't perform argument conversion for dependent types #7009

Closed
RedBeard0531 opened this issue Jan 1, 2018 · 2 comments · Fixed by #24525
Closed

Comments

@RedBeard0531
Copy link
Contributor

type Node[T] = object
    val: T

proc genericProc(s: Node; key: s.T) =
    discard # body doesn't matter
proc explicitGenericProc[T](s: Node[T]; key: T) =
    discard # body doesn't matter
proc concreteProc(s: Node[cstring]; key: s.T) =
    discard # body doesn't matter 
    
var strs: Node[cstring]
concreteProc(strs, "string") # string converts to cstring
explicitGenericProc(strs, "string") # still converts
genericProc(strs, "string") # doesn't convert: COMPILE ERROR
@RedBeard0531
Copy link
Contributor Author

#7008 was discovered trying to make a minimal repro for this.
#7006 may be related.

@metagn
Copy link
Collaborator

metagn commented Nov 1, 2024

Works in 2.2, likely same fix as #7006

metagn added a commit to metagn/Nim that referenced this issue Dec 8, 2024
@Araq Araq closed this as completed in aeb3fe9 Dec 9, 2024
narimiran pushed a commit that referenced this issue Jan 14, 2025
closes #6013, closes #7009, closes #9190, closes #12487, closes #12831,
closes #13184, closes #13252, closes #14860, closes #14877, closes
#14894, closes #14917, closes #16153, closes #16439, closes #17779,
closes #18074, closes #18202, closes #18314, closes #18648, closes
#19063, closes #19446, closes #20065, closes #20367, closes #22126,
closes #22820, closes #22888, closes #23020, closes #23287, closes
#23510

(cherry picked from commit aeb3fe9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants