-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Union causes incorrect type parameter extraction? #41841
Comments
This should give an UndefVarError, but that can be hard to determine, so we are currently somewhat conservative and return a result, if it none should be returned. Closing as related to / duplicate of #41728 |
why should it give an in the error case:
|
We merely have |
to clarify, the specific error occurs only when there are more than one
that said, when more than one |
oh, I see now there is an assertion that |
I see the problem here, but yes, this is difficult!! Us humans have a lovely way of being able to "just see" certain things 😄 |
it's difficult ... requiring some "AI inference" !!! my suggestion is: as long as the type inference is beyond the (current) ability of julia, it should throw an "InferenceError" to force the user to adapt other type specifications right now, it's doing some wrong inference instead of detecting a difficult inference problem... also worth noting is that Windows has no error?! It means that the "wrong inference" luckily make the correct inference? This inconsistency between Windows and Mac is worrisome... |
Issue #42710 was closed as a duplicate of this. The refined example that was used there is the following (issues reproduced with 1.6.3, 1.7.0-rc1 and master; note that no stacktrace is printed):
The confusion here is why it would match
alas...
|
Because |
This is fixed now |
in a fresh Mac v1.6.2 session:
error seems coming from mistaking
Union{Missing, Float64}
asT
, which should beFloat64
, in the default keyword argument assignment.noted that if I supply the keyboard argument such that the default value assignment is not called, no error:
it seems to be a bug in extracting the
T
(whenUnion
is involved?).the original discussion is from here. Thanks.
The text was updated successfully, but these errors were encountered: