Skip to content

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

Closed
@metagn

Description

@metagn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions