Skip to content

Commit 55b5646

Browse files
committed
handling Base printing of Expr.typ fields not containing a Type
this allows printing of the Exprs flowing through inference (which might instead have the field set to something like a Const object)
1 parent 72b48c7 commit 55b5646

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/show.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ typeemphasize(io::IO) = get(io, :TYPEEMPHASIZE, false) === true
522522

523523
const indent_width = 4
524524

525-
function show_expr_type(io::IO, ty, emph)
525+
function show_expr_type(io::IO, ty::ANY, emph::Bool)
526526
if ty === Function
527527
print(io, "::F")
528528
elseif ty === Core.IntrinsicFunction
@@ -627,7 +627,7 @@ function show_unquoted(io::IO, ex::Slot, ::Int, ::Int)
627627
if isa(slottypes, Array) && slotid <= length(slottypes::Array)
628628
slottype = slottypes[slotid]
629629
# The Slot in assignment can somehow have an Any type
630-
if slottype <: typ
630+
if isa(slottype, Type) && isa(typ, Type) && slottype <: typ
631631
typ = slottype
632632
end
633633
end

0 commit comments

Comments
 (0)