Possible Bug regarding TypeVar?

julia> struct LL{T}
           x::T
       end

julia> emulate_type(tv::TypeVar) = tv.ub == Any ? Union{tv,LL{tv}} : tv
emulate_type (generic function with 1 method)

julia> emulate_type(TypeVar(:T))
Unreachable reached at 0x118fb3a20

signal (4): Illegal instruction: 4
in expression starting at no file:0
emulate_type at ./REPL[2]:1
jl_fptr_trampoline at /Users/osx/buildbot/slave/package_osx64/build/src/gf.c:1831
do_call at /Users/osx/buildbot/slave/package_osx64/build/src/interpreter.c:324
eval_stmt_value at /Users/osx/buildbot/slave/package_osx64/build/src/interpreter.c:363 [inlined]
eval_body at /Users/osx/buildbot/slave/package_osx64/build/src/interpreter.c:682
jl_interpret_toplevel_thunk_callback at /Users/osx/buildbot/slave/package_osx64/build/src/interpreter.c:806
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x113fae12f)
unknown function (ip: 0x0)
jl_interpret_toplevel_thunk at /Users/osx/buildbot/slave/package_osx64/build/src/interpreter.c:815
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx64/build/src/toplevel.c:805
jl_toplevel_eval_in at /Users/osx/buildbot/slave/package_osx64/build/src/builtins.c:622
eval at ./boot.jl:319
eval_user_input at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:85
macro expansion at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:117 [inlined]
#28 at ./task.jl:259
jl_apply at /Users/osx/buildbot/slave/package_osx64/build/src/./julia.h:1537 [inlined]
start_task at /Users/osx/buildbot/slave/package_osx64/build/src/task.c:268
Allocations: 1208452 (Pool: 1208096; Big: 356); GC: 1
[1]    22236 illegal hardware instruction  julia

Maybe you can check whether https://github.com/JuliaLang/julia/pull/31747 resolved this. Otherwise (or if you can’t check) please file an issue.

1 Like