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

Internal error in abstract_iteration #36531

Closed
Keno opened this issue Jul 4, 2020 · 1 comment
Closed

Internal error in abstract_iteration #36531

Keno opened this issue Jul 4, 2020 · 1 comment
Labels
compiler:inference Type inference

Comments

@Keno
Copy link
Member

Keno commented Jul 4, 2020

Happens on master and at least back to 1.4:

julia> f(args...) = Core._apply_iterate(Base.iterate, identity, args...)
f (generic function with 1 method)

julia> f(1,2,3)
Internal error: encountered unexpected error in runtime:
TypeError(func=:Tuple, context="non-final parameter", expected=Type, got=Vararg{Int64, N} where N)
jl_type_error_rt at /home/keno/julia/src/rtutils.c:118
jl_f_apply_type at /home/keno/julia/src/builtins.c:959
jl_apply at /home/keno/julia/src/julia.h:1711 [inlined]
do_apply at /home/keno/julia/src/builtins.c:655
argtypes_to_type at ./compiler/typeutils.jl:46 [inlined]
abstract_call_known at ./compiler/abstractinterpretation.jl:908
abstract_call_known at ./compiler/abstractinterpretation.jl:698
abstract_iteration at ./compiler/abstractinterpretation.jl:589
precise_container_type at ./compiler/abstractinterpretation.jl:536
@Keno Keno added the compiler:inference Type inference label Jul 4, 2020
Keno pushed a commit that referenced this issue Jul 4, 2020
The issue here is passing a `Vargarg` to `precise_container_type`, which
doesn't really make sense. Instead, we need to have the caller unwrap
the vararg, request the precise container type of the inner type and
then re-wrap the answer in a vararg.
Keno pushed a commit that referenced this issue Jul 4, 2020
The issue here is passing a `Vargarg` to `precise_container_type`, which
doesn't really make sense. Instead, we need to have the caller unwrap
the vararg, request the precise container type of the inner type and
then re-wrap the answer in a vararg.
Keno added a commit that referenced this issue Jul 4, 2020
The issue here is passing a `Vargarg` to `precise_container_type`, which
doesn't really make sense. Instead, we need to have the caller unwrap
the vararg, request the precise container type of the inner type and
then re-wrap the answer in a vararg.
@martinholters
Copy link
Member

Just a small note: it is not necessary to manually call Core._apply_iterate which may seem like it's not particularly relevant for "normal" code. But the above is actually equivalent to f(args...) = identity((args...)...) (which, admittedly, may still be a bit unusual).

Keno added a commit that referenced this issue Jul 6, 2020
The issue here is passing a `Vargarg` to `precise_container_type`, which
doesn't really make sense. Instead, we need to have the caller unwrap
the vararg, request the precise container type of the inner type and
then re-wrap the answer in a vararg.
@Keno Keno closed this as completed in 63179af Jul 7, 2020
martinholters pushed a commit that referenced this issue Jul 9, 2020
The issue here is passing a `Vargarg` to `precise_container_type`, which
doesn't really make sense. Instead, we need to have the caller unwrap
the vararg, request the precise container type of the inner type and
then re-wrap the answer in a vararg.

(cherry picked from commit 63179af)
KristofferC pushed a commit that referenced this issue Jul 10, 2020
The issue here is passing a `Vargarg` to `precise_container_type`, which
doesn't really make sense. Instead, we need to have the caller unwrap
the vararg, request the precise container type of the inner type and
then re-wrap the answer in a vararg.

(cherry picked from commit 63179af)
simeonschaub pushed a commit to simeonschaub/julia that referenced this issue Aug 11, 2020
The issue here is passing a `Vargarg` to `precise_container_type`, which
doesn't really make sense. Instead, we need to have the caller unwrap
the vararg, request the precise container type of the inner type and
then re-wrap the answer in a vararg.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

No branches or pull requests

2 participants