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

Ambiguous call from forward declared procedure created in a macro #12175

Open
PMunch opened this issue Sep 11, 2019 · 5 comments
Open

Ambiguous call from forward declared procedure created in a macro #12175

PMunch opened this issue Sep 11, 2019 · 5 comments

Comments

@PMunch
Copy link
Contributor

PMunch commented Sep 11, 2019

After a bug in nimsuggest was fixed that should keep nimlsp from crashing I tried to build nimlsp on the latest devel. This causes the error:

Error: ambiguous call; both nimlsp.isValid(data: JsonNode, schemaType`gensym1028144: type RequestMessage, traverse: bool, allowExtra: bool) [declared in /home/peter/.nimble/pkgs/jsonschema-0.2.0/jsonschema.nim(360, 12)] and nimlsp.isValid(data: JsonNode, schemaType`gensym1028145: type RequestMessage, traverse: bool, allowExtra: bool) [declared in /home/peter/.nimble/pkgs/jsonschema-0.2.0/jsonschema.nim(367, 12)] match for: (JsonNode, type RequestMessage)

The two procedures point to the macro code that generates them and one is only a forward declaration while the other is the procedure with the body.

@Araq
Copy link
Member

Araq commented Sep 11, 2019

The forward declaration uses a different gensym'ed symbol so the compiler thinks you introduced two separate procs.

@veksha
Copy link

veksha commented May 10, 2022

Is it still relevant?

I see error while checking nimlsp.nim with nimlsp:
ambiguous call; both nimlsp.create(schemaType: typedesc[Diagnostic], therange: Range, severity: Option[system.int] or Option[system.float], code: Option[system.int] or Option[system.float] or Option[nimlsp.ResponseError], source: Option[system.string], message: string, relatedInformation: Option[seq[DiagnosticRelatedInformation]]) [proc declared in C:\Users\yura\.nimble\pkgs\jsonschema-0.2.1\jsonschema.nim(389, 12)] and nimlsp.create(schemaType: typedesc[Diagnostic], therange: Range, severity: Option[system.int] or Option[system.float], code: Option[system.int] or Option[system.float] or Option[system.string], source: Option[system.string], message: string, relatedInformation: Option[seq[DiagnosticRelatedInformation]]) [proc declared in C:\Users\yura\.nimble\pkgs\jsonschema-0.2.1\jsonschema.nim(382, 12)] match for: (typedesc[Diagnostic], Range, Option[system.int], Option[system.int], Option[system.string], string, Option[seq[DiagnosticRelatedInformation]])

it compiles correctly of course. so can it be bug in nimsuggest module that is used by nimlsp?

@PMunch
Copy link
Contributor Author

PMunch commented May 10, 2022

Yeah that sounds like a nimsuggest bug, which version of Nim sources did you use when building nimlsp?

@veksha
Copy link

veksha commented May 10, 2022

Yeah that sounds like a nimsuggest bug, which version of Nim sources did you use when building nimlsp?

Nim Compiler Version 1.6.5 [Windows: amd64]
Compiled at 2022-04-21
dc4cc2d (commited 27 days ago)

@veksha
Copy link

veksha commented May 11, 2022

same with last devel nim sources.

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

3 participants