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

Identifier referring to multiple routine symbols gives type None error #13215

Closed
metagn opened this issue Jan 21, 2020 · 1 comment
Closed

Identifier referring to multiple routine symbols gives type None error #13215

metagn opened this issue Jan 21, 2020 · 1 comment

Comments

@metagn
Copy link
Collaborator

metagn commented Jan 21, 2020

The error message should indicate that the compiler cannot choose between the symbols and which symbols are the possible matches.

Example

proc foo(a: int) = echo a
proc foo(a: string) = echo a

let y = foo

Current Output

/usercode/in.nim(4, 5) Error: invalid type: 'None' for let

Possible Solution

/usercode/in.nim(4, 5) Error: identifier 'foo' matches both in.foo(a: int) [declared in /usercode/in.nim(1, 6)] and in.foo(a: string) [declared in /usercode/in.nim(2, 10)] and a type conversion must be used to declare a procvar

Excuse my bad writing. If there is an overload with no arguments it would append Did you mean to do 'foo()'? to the end

$ nim -v
Nim Compiler Version 1.0.4
@metagn
Copy link
Collaborator Author

metagn commented Jan 21, 2020

Never mind, duplicate of #6359

@metagn metagn closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant