From ad977cb4206e27a0c9e0edb5aa68a5ef966529c0 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 23 Sep 2020 10:34:07 -0400 Subject: [PATCH] inference: relax isbrokensubtype for egal objects --- base/compiler/typeutils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/compiler/typeutils.jl b/base/compiler/typeutils.jl index 9316b67af4953..546f4e90bd478 100644 --- a/base/compiler/typeutils.jl +++ b/base/compiler/typeutils.jl @@ -41,7 +41,7 @@ end # some of these queries, this check can be used to somewhat protect against making incorrect # decisions based on incorrect subtyping. Note that this check, itself, is broken for # certain combinations of `a` and `b` where one/both isa/are `Union`/`UnionAll` type(s)s. -isnotbrokensubtype(@nospecialize(a), @nospecialize(b)) = (!iskindtype(b) || !isType(a) || hasuniquerep(a.parameters[1])) +isnotbrokensubtype(@nospecialize(a), @nospecialize(b)) = (!iskindtype(b) || !isType(a) || hasuniquerep(a.parameters[1]) || b <: a) argtypes_to_type(argtypes::Array{Any,1}) = Tuple{anymap(widenconst, argtypes)...}