Skip to content

Version 0.5 gives errors on strings, on Julia 1.12 #92

Closed
@mcabbott

Description

@mcabbott
julia> using Functors

julia> fmap(x -> @show(x), (a=1, b="23"))
Internal error: during type inference of
execute(Functors.CachedWalk{Functors.ExcludeWalk{Functors.DefaultWalk, Main.var"#8#9", typeof(Functors.isleaf)}, Functors.NoKeyword, Functors.WalkCache{Any, Any, Functors.ExcludeWalk{Functors.DefaultWalk, Main.var"#8#9", typeof(Functors.isleaf)}, Base.IdDict{Any, Any}}}, NamedTuple{(:a, :b), Tuple{Int64, String}})
Encountered unexpected error in runtime:
AssertionError(msg="invalid `given_argtypes` for `mi`")
va_process_argtypes at ./compiler/inferenceresult.jl:123
InferenceState at ./compiler/inferencestate.jl:314
InferenceState at ./compiler/inferencestate.jl:555
typeinf_edge at ./compiler/typeinfer.jl:796
abstract_call_method at ./compiler/abstractinterpretation.jl:736
infercalls at ./compiler/abstractinterpretation.jl:96
jfptr_infercalls_33787 at /Users/me/.julia/dev/julia/usr/lib/julia/sys.dylib (unknown line)
...
x = 1
x = "23"
(a = 1, b = "23")

julia> Functors.@leaf String  # this isn't the problem

julia> fmap(x -> @show(x), (a=1, b="23"))
Internal error: during type inference of
execute(Functors.CachedWalk{Functors.ExcludeWalk{Functors.DefaultWalk, Main.var"#29#30", typeof(Functors.isleaf)}, Functors.NoKeyword, Functors.WalkCache{Any, Any, Functors.ExcludeWalk{Functors.DefaultWalk, Main.var"#29#30", typeof(Functors.isleaf)}, Base.IdDict{Any, Any}}}, NamedTuple{(:a, :b), Tuple{Int64, String}})
Encountered unexpected error in runtime:
...

(jl_DJAD83) pkg> st
Status `/private/var/folders/yq/4p2zwd614y59gszh7y9ypyhh0000gn/T/jl_DJAD83/Project.toml`
  [d9f16b24] Functors v0.5.0

julia> VERSION
v"1.12.0-DEV.1375"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions