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

Dynamic dispatch and Union type situations #4

Open
shashi opened this issue May 8, 2020 · 1 comment
Open

Dynamic dispatch and Union type situations #4

shashi opened this issue May 8, 2020 · 1 comment

Comments

@shashi
Copy link
Contributor

shashi commented May 8, 2020

Tracing may not be possible in situations where there is no unique next method to pick to trace. But this situation should occur way less with Mjolnir as opposed to using the standard Julia type inference as can be seen in this example

For example, if you have Dict{Any,Any} – we can see all the set and getindexes, so we can infer keys of the dictionary as if they were local variables

But should document when exactly it won't work, and provide reasonable suggestions to avoid those cases.

@MikeInnes
Copy link
Member

Better yet, it would be nice if we could give precise diagnostics that say why code is untyped and how to fix it. This is still a bit abstract for me though; I'm hoping to see some failure cases from from users, which should help us explain mjolnir's failure cases in user terms.

There aren't that many sources of unions in standard Julia code. Iteration is one case that we should definitely support. Try/catch and recursive types are a source of Anys in normal Julia inference which we don't currently support; potentially we could make those things inferable though, e.g. if we have effect inference.

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

2 participants