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

Open
RedBeard0531 opened this issue Jan 1, 2018 · 2 comments

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants