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

Idetools resolves wrong method for dynamic dispatch example #477

Closed
gradha opened this issue Jun 10, 2013 · 3 comments
Closed

Idetools resolves wrong method for dynamic dispatch example #477

gradha opened this issue Jun 10, 2013 · 3 comments
Labels

Comments

@gradha
Copy link
Contributor

gradha commented Jun 10, 2013

The second example at http://nimrod-code.org/tut2.html#dynamic-dispatch when run produces the output 2. However, when that example is queried with idetools the call to collide resolves to the version echoing 1.

@Araq
Copy link
Member

Araq commented Jun 12, 2013

It should resolve to the dispatching method (the one that quits). Note that it can't determine which method is really run as that would require running the program.

@gradha
Copy link
Contributor Author

gradha commented Jun 12, 2013

I understand that dynamic dispatch requires runtime execution and is out of the scope of idetools, but in this case none of the provided collide signatures match the provided parameters exactly if you consider subclasses a different type. So you could argue the logic to pick one of the methods could be the same as at runtime.

On the other hand, since this is not going to work reliably for all cases, why not avoid the difficult decissions and make idetools spit out all the available matching methods? The current version outputs only one method, but it would be neat if all were dumped so the final end user inside the IDE can pick the correct one to jump to. Presumably similar code is already in use for the --suggest idetools option, so idetools could default to the logic of --suggest and at least try to make the first item in the list the closest match possible?

reactormonk pushed a commit to reactormonk/nim that referenced this issue Apr 7, 2014
@Araq
Copy link
Member

Araq commented Jan 17, 2016

nimsuggest has its own bug tracker.

@Araq Araq closed this as completed Jan 17, 2016
Clyybber pushed a commit to Clyybber/Nim that referenced this issue Sep 16, 2023
477: move 'collections' category to stdlib r=haxscramper a=haxscramper



Co-authored-by: haxscramper <haxscramper@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants