I hit a bug very similar to #30122. Unfortunately I was not able to reduce this to a self-contained example. This is on the release-1.1 branch.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0-DEV.839 (2018-12-07)
_/ |\__'_|_|_|\__'_| | Commit b55b85cd99 (3 days old master)
|__/ |
julia> versioninfo()
Julia Version 1.1.0-DEV.839
Commit b55b85cd99 (2018-12-07 17:20 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.0.0)
CPU: Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS = 4
julia> using DynamicPolynomials
[ Info: Precompiling DynamicPolynomials [7c1d4256-1411-5781-91ec-d7bc3513ac07]
julia> @polyvar x[1:2]
Unreachable reached at 0x12a28a3ca
signal (4): Illegal instruction: 4
in expression starting at no file:0
setindex! at ./array.jl:764
collect_to_with_first! at ./array.jl:626
collect at ./array.jl:608
map at ./abstractarray.jl:2044 [inlined]
polyarrayvar at /Users/sascha/.julia/packages/DynamicPolynomials/3rBvr/src/var.jl:6
unknown function (ip: 0x12a28a37d)
jl_fptr_trampoline at /Users/sascha/coding/julia/src/gf.c:1854
do_call at /Users/sascha/coding/julia/src/interpreter.c:323
eval_stmt_value at /Users/sascha/coding/julia/src/interpreter.c:362 [inlined]
eval_body at /Users/sascha/coding/julia/src/interpreter.c:759
jl_interpret_toplevel_thunk_callback at /Users/sascha/coding/julia/src/interpreter.c:885
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x117da000f)
unknown function (ip: 0x1)
jl_interpret_toplevel_thunk at /Users/sascha/coding/julia/src/interpreter.c:894
jl_toplevel_eval_flex at /Users/sascha/coding/julia/src/toplevel.c:764
jl_toplevel_eval at /Users/sascha/coding/julia/src/toplevel.c:773 [inlined]
jl_toplevel_eval_in at /Users/sascha/coding/julia/src/toplevel.c:793
eval at ./boot.jl:328
eval_user_input at /Users/sascha/coding/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /Users/sascha/coding/julia/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_apply at /Users/sascha/coding/julia/src/./julia.h:1571 [inlined]
start_task at /Users/sascha/coding/julia/src/task.c:572
Allocations: 12189244 (Pool: 12186847; Big: 2397); GC: 26
Illegal instruction: 4
Can reproduce on release-1.1
, assertion that is hit: julia: /home/tbesard/Julia/julia-dev/src/gf.c:1200: int check_ambiguous_visitor(jl_typemap_entry_t *, struct typemap_intersection_env *): Assertion `!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)' failed.
EDIT: also on master, so not resolved (https://github.com/JuliaAlgebra/DynamicPolynomials.jl/issues/38#issuecomment-446157080)
Reduced:
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.1.0-DEV.854 (2018-12-11)
_/ |\__'_|_|_|\__'_| | Commit 0d620001c2* (0 days old master)
|__/ |
julia> module Foo
abstract type A end
abstract type B end
Base.convert(::Type{T}, ::A) where T<:B = nothing
Base.convert(::Type{<:Union{Number, T}}, ::A) where T = nothing
end
julia: /home/tbesard/Julia/julia-dev/src/gf.c:1200: int check_ambiguous_visitor(jl_typemap_entry_t *, struct typemap_intersection_env *): Assertion `!jl_subtype((jl_value_t*)sig, (jl_value_t*)type)' failed.
signal (6): Aborted
in expression starting at no file:5
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f5622411a89)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
check_ambiguous_visitor at /home/tbesard/Julia/julia-dev/src/gf.c:1200
jl_typemap_intersection_node_visitor at /home/tbesard/Julia/julia-dev/src/typemap.c:0
jl_typemap_intersection_visitor at /home/tbesard/Julia/julia-dev/src/typemap.c:553
jl_typemap_intersection_visitor at /home/tbesard/Julia/julia-dev/src/typemap.c:544
check_ambiguous_matches at /home/tbesard/Julia/julia-dev/src/gf.c:1287
jl_method_table_insert at /home/tbesard/Julia/julia-dev/src/gf.c:1565
jl_method_def at /home/tbesard/Julia/julia-dev/src/method.c:800
eval_methoddef at /home/tbesard/Julia/julia-dev/src/interpreter.c:309
eval_body at /home/tbesard/Julia/julia-dev/src/interpreter.c:732
jl_interpret_toplevel_thunk_callback at /home/tbesard/Julia/julia-dev/src/interpreter.c:885
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f5615caae4f)
unknown function (ip: 0xa)
jl_interpret_toplevel_thunk at /home/tbesard/Julia/julia-dev/src/interpreter.c:894
jl_toplevel_eval_flex at /home/tbesard/Julia/julia-dev/src/toplevel.c:764
jl_eval_module_expr at /home/tbesard/Julia/julia-dev/src/toplevel.c:179
jl_toplevel_eval_flex at /home/tbesard/Julia/julia-dev/src/toplevel.c:614
jl_toplevel_eval at /home/tbesard/Julia/julia-dev/src/toplevel.c:773 [inlined]
jl_toplevel_eval_in at /home/tbesard/Julia/julia-dev/src/toplevel.c:793
eval at ./boot.jl:328
jl_apply_generic at /home/tbesard/Julia/julia-dev/src/gf.c:2209
eval_user_input at /home/tbesard/Julia/julia-dev/build/release/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /home/tbesard/Julia/julia-dev/build/release/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_fptr_trampoline at /home/tbesard/Julia/julia-dev/src/gf.c:1854
jl_apply_generic at /home/tbesard/Julia/julia-dev/src/gf.c:2209
jl_apply at /home/tbesard/Julia/julia-dev/src/julia.h:1571 [inlined]
start_task at /home/tbesard/Julia/julia-dev/src/task.c:572
unknown function (ip: 0xffffffffffffffff)
Allocations: 11775953 (Pool: 11773673; Big: 2280); GC: 25
zsh: abort ./julia
The assertion failure is not necessarily related.
Ah, it looks like in this case it is, since the compiler and runtime seem to disagree on whether there is an ambiguity error.
Most helpful comment
Reduced: