Skip to content

Commit c9f9e98

Browse files
authored
Merge pull request #201 from lassepe/fix/interpolation
Correctly interpolate `TypeBind`
2 parents 2b843b2 + 4b755b5 commit c9f9e98

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/match/types.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function tbnew(s::Symbol)
1818
ts = map(Symbol, split(string(s), "_"))
1919
name = popfirst!(ts)
2020
ts = (totype(t) for t in ts)
21-
Expr(:$, :(MacroTools.TypeBind($(Expr(:quote, name)), Set{Any}([$(ts...)]))))
21+
Expr(:$, :($TypeBind($(Expr(:quote, name)), Set{Any}([$(ts...)]))))
2222
end
2323

2424
match_inner(b::TypeBind, ex, env) =

test/match.jl

+6
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,9 @@ let
9696
@capture(ex, $f(args__))
9797
@test args == [:a, :b]
9898
end
99+
100+
# https://github.com/FluxML/MacroTools.jl/pull/200
101+
module TestExplicitImport
102+
using MacroTools: @capture
103+
@capture(:(x = 2), _lhs = _rhs)
104+
end

0 commit comments

Comments
 (0)