Skip to content

Commit ad977cb

Browse files
committed
inference: relax isbrokensubtype for egal objects
1 parent 5a56ecd commit ad977cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/compiler/typeutils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ end
4141
# some of these queries, this check can be used to somewhat protect against making incorrect
4242
# decisions based on incorrect subtyping. Note that this check, itself, is broken for
4343
# certain combinations of `a` and `b` where one/both isa/are `Union`/`UnionAll` type(s)s.
44-
isnotbrokensubtype(@nospecialize(a), @nospecialize(b)) = (!iskindtype(b) || !isType(a) || hasuniquerep(a.parameters[1]))
44+
isnotbrokensubtype(@nospecialize(a), @nospecialize(b)) = (!iskindtype(b) || !isType(a) || hasuniquerep(a.parameters[1]) || b <: a)
4545

4646
argtypes_to_type(argtypes::Array{Any,1}) = Tuple{anymap(widenconst, argtypes)...}
4747

0 commit comments

Comments
 (0)