diff --git a/src/match/types.jl b/src/match/types.jl index aea64b7..b733e73 100644 --- a/src/match/types.jl +++ b/src/match/types.jl @@ -18,7 +18,7 @@ function tbnew(s::Symbol) ts = map(Symbol, split(string(s), "_")) name = popfirst!(ts) ts = (totype(t) for t in ts) - Expr(:$, :(MacroTools.TypeBind($(Expr(:quote, name)), Set{Any}([$(ts...)])))) + Expr(:$, :($TypeBind($(Expr(:quote, name)), Set{Any}([$(ts...)])))) end match_inner(b::TypeBind, ex, env) = diff --git a/test/match.jl b/test/match.jl index 11f42ac..ce19a7f 100644 --- a/test/match.jl +++ b/test/match.jl @@ -96,3 +96,9 @@ let @capture(ex, $f(args__)) @test args == [:a, :b] end + +# https://github.com/FluxML/MacroTools.jl/pull/200 +module TestExplicitImport +using MacroTools: @capture +@capture(:(x = 2), _lhs = _rhs) +end