Skip to content

Commit 8742b16

Browse files
committed
Improve inferrability of isor
1 parent dc0ca76 commit 8742b16

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/match/union.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ function match_inner(pat::OrBind, ex, env)
1111
env′ == nothing ? match(pat.pat2, ex, env) : merge!(env, env′)
1212
end
1313

14-
isor(ex) = isexpr(ex, :call) && ex.args[1] in (:or_, :|)
14+
function isor(ex)
15+
if isexpr(ex, :call)
16+
arg1 = ex.args[1]
17+
return arg1 isa Symbol && arg1 in (:or_, :|)
18+
end
19+
return false
20+
end
1521

1622
function ornew(ex)
1723
isor(ex) || return ex

0 commit comments

Comments
 (0)