Issue 1:
Compare:

julia> A = Diagonal(rand(1000))
1000×1000 Diagonal{Float64,Array{Float64,1}}:
0.0341907 ⋅ ⋅ ⋅ … ⋅ ⋅ ⋅
⋅ 0.758919 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 0.700876 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ 0.453502 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ … ⋅ ⋅ ⋅
⋮ ⋱
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ … ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 0.489115 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ 0.791967 ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 0.164329

julia> sparse(A)
1000×1000 SparseMatrixCSC{Float64,Int64} with 1000 stored entries:
[1 , 1] = 0.0341907
[2 , 2] = 0.758919
[3 , 3] = 0.700876
[4 , 4] = 0.453502
[5 , 5] = 0.560549
[6 , 6] = 0.832382
⋮
[995 , 995] = 0.270777
[996 , 996] = 0.0664044
[997 , 997] = 0.689441
[998 , 998] = 0.489115
[999 , 999] = 0.791967
[1000, 1000] = 0.164329

Why can't a SparseMatrixCSC be printed in the same way as the structured sparse-matrix types? It would be a heck of a lot more readable.

PS. On an unrelated note, I also notice that the SparseMatrixCSC output isn't setting the :typeinfo property of the IOContext, so it screws up e.g. #30575. Update: This is fixed by #30589.

Issue 2:
Disclamer: This very well may be duplicate for #22123 (or rather #21191 #21153, @martinholters should know better, I guess).

I have this (crazy, unrealistic, computer-generated) type:

Ref{Tuple{T,Ref{Union{Ref{Tuple{Ref{Union{Ref{Ref{Tuple{Ref{Tuple{Union{Tuple{Ref{Ref{T}},T}, T},T}},T}}}, T}},T}}, Ref{T}, T}}}} where T

Julia (recent master) dies when I try to check reflexivity for it:

t = Ref{Tuple{T,Ref{Union{Ref{Tuple{Ref{Union{Ref{Ref{Tuple{Ref{Tuple{Union{Tuple{Ref{Ref{T}},T}, T},T}},T}}}, T}},T}}, Ref{T}, T}}}} where T

s = Ref{Tuple{T,Ref{Union{Ref{Tuple{Ref{Union{Ref{Ref{Tuple{Ref{Tuple{Union{Tuple{Ref{Ref{T}},T}, T},T}},T}}}, T}},T}}, Ref{T}, T}}}} where T

t <: s

(I use different bindings, s and t, otherwise it will trivially says true.)

I compared the output to the one of #22123, here is the diff. They are very similar, but one call to subtype_unionall. I was about to forget this, but as a last resort fired up julia-debug. And there I got notably different output. So i decided to file a bug. The output from julia-debugis:

julia-debug: /home/artem/julia-dev/src/subtype.c:114: statestack_get: Assertion `i >= 0 && i < sizeof(st->stack) * 8' failed.

signal (6): Aborted
in expression starting at /home/artem/julia-work/exp/crash-rj1.jl:7
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: 0x7fc23523dbd6)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
statestack_get at /home/artem/julia-dev/src/subtype.c:114
pick_union_element at /home/artem/julia-dev/src/subtype.c:388
subtype at /home/artem/julia-dev/src/subtype.c:846
subtype_ufirst at /home/artem/julia-dev/src/subtype.c:416
var_lt at /home/artem/julia-dev/src/subtype.c:454
subtype at /home/artem/julia-dev/src/subtype.c:883
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_tuple at /home/artem/julia-dev/src/subtype.c:796
subtype at /home/artem/julia-dev/src/subtype.c:926
forall_exists_equal at /home/artem/julia-dev/src/subtype.c:985
subtype at /home/artem/julia-dev/src/subtype.c:946
subtype_unionall at /home/artem/julia-dev/src/subtype.c:593
subtype at /home/artem/julia-dev/src/subtype.c:896
subtype_unionall at /home/artem/julia-dev/src/subtype.c:624
subtype at /home/artem/julia-dev/src/subtype.c:893
exists_subtype at /home/artem/julia-dev/src/subtype.c:1009
forall_exists_subtype at /home/artem/julia-dev/src/subtype.c:1037
jl_subtype_env at /home/artem/julia-dev/src/subtype.c:1091
jl_subtype at /home/artem/julia-dev/src/subtype.c:1109
jl_f_issubtype at /home/artem/julia-dev/src/builtins.c:416
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
do_call at /home/artem/julia-dev/src/interpreter.c:323
eval_value at /home/artem/julia-dev/src/interpreter.c:395
eval_body at /home/artem/julia-dev/src/interpreter.c:509
jl_interpret_toplevel_thunk_callback at /home/artem/julia-dev/src/interpreter.c:720
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7fc2270e190f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /home/artem/julia-dev/src/interpreter.c:729
jl_toplevel_eval_flex at /home/artem/julia-dev/src/toplevel.c:806
jl_parse_eval_all at /home/artem/julia-dev/src/ast.c:839
jl_load at /home/artem/julia-dev/src/toplevel.c:844
jl_load_ at /home/artem/julia-dev/src/toplevel.c:851
include at ./boot.jl:296 [inlined]
include_relative at ./loading.jl:1012
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
include at ./sysimg.jl:26
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
exec_options at ./client.jl:332
_start at ./client.jl:447
jl_call_fptr_internal at /home/artem/julia-dev/src/julia_internal.h:383
jl_call_method_internal at /home/artem/julia-dev/src/julia_internal.h:402
jl_apply_generic at /home/artem/julia-dev/src/gf.c:2089
jl_apply at /home/artem/julia-dev/ui/../src/julia.h:1523
true_main at /home/artem/julia-dev/ui/repl.c:107
main at /home/artem/julia-dev/ui/repl.c:238
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at ./julia-debug (unknown line)
Allocations: 461264 (Pool: 460989; Big: 275); GC: 0
Aborted (core dumped)

Versioninfo:

Julia Version 0.7.0-DEV.3716
Commit 842ff17 (2018-02-05 03:16 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)