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

Closed
noonien opened this issue May 6, 2019 · 0 comments
Closed

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

noonien opened this issue May 6, 2019 · 0 comments

Comments

@noonien
Copy link

noonien commented May 6, 2019

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

Example

a.nim

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

discard "foo".bar()

b.nim

# 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()

baz.nim

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
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

3 participants