From 81a7ee2ef18bee31d62838c4e5229e8df71b3b25 Mon Sep 17 00:00:00 2001 From: N5N3 <2642243996@qq.com> Date: Wed, 10 Aug 2022 15:09:53 +0800 Subject: [PATCH] Fuse `in_union` --- src/subtype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subtype.c b/src/subtype.c index fcb4aac2aaef21..e05965caa0ee73 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -1170,7 +1170,7 @@ static int subtype(jl_value_t *x, jl_value_t *y, jl_stenv_t *e, int param) x = pick_union_element(x, e, 0); } if (jl_is_uniontype(y)) { - if (x == ((jl_uniontype_t*)y)->a || x == ((jl_uniontype_t*)y)->b) + if (in_union(y, x)) return 1; if (jl_is_unionall(x)) return subtype_unionall(y, (jl_unionall_t*)x, e, 0, param);