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

symbol resolution issues when ambiguous call happens in generic proc #11188

noonien opened this issue May 6, 2019 · 0 comments


None yet
3 participants
Copy link

commented May 6, 2019

Symbol seems to happen when the generic proc is used, not where it's defined.



import b
# importing baz causes the error not to trigger
#import baz

discard "foo".bar()


# the module being the same name as the proc
# is a requirement to trigger the error
import baz

# if this is not generic, error does not occur
proc bar*[T](foo: T): bool = foo.baz()


proc baz*(x: string): bool = x.len > 0

Current Output

a.nim(4, 14) template/generic instantiation of `bar` from here
b.nim(6, 33) Error: attempting to call undeclared routine: 'baz'

Expected Output

Possible Solution

Additional Information

nightly devel version: 2019-05-02-devel-c94ab46

$ nim -v
Nim Compiler Version 0.19.9 [Linux: amd64]
Compiled at 2019-05-02
Copyright (c) 2006-2019 by Andreas Rumpf

active boot switches: -d:release -d:nativeStackTrace

@Araq Araq added the High Priority label May 23, 2019

Araq added a commit that referenced this issue May 24, 2019

@Araq Araq closed this in 7e53c1c May 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.