Skip to content

Commit 2dd53bf

Browse files
committed
raise an explicit error
1 parent 7cf7ae0 commit 2dd53bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/macro_expansion.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ end
9292
function scrub_expand_macro_stacktrace(stacktrace::Vector{Base.StackTraces.StackFrame})
9393
idx = @something findfirst(stacktrace) do stackframe::Base.StackTraces.StackFrame
9494
stackframe.func === :expand_macro && stackframe.file === Symbol(@__FILE__)
95-
end return stacktrace
95+
end error("`scrub_expand_macro_stacktrace` is expected to be called from `expand_macro`")
9696
return stacktrace[1:idx-1]
9797
end
9898

@@ -121,7 +121,7 @@ function Base.showerror(io::IO, exc::MacroExpansionError)
121121
highlight(io, src.file, byterange, note=exc.msg)
122122
end
123123

124-
function eval_macro_name(ctx, ex)
124+
function eval_macro_name(ctx::MacroExpansionContext, ex::SyntaxTree)
125125
# `ex1` might contain a nontrivial mix of scope layers so we can't just
126126
# `eval()` it, as it's already been partially lowered by this point.
127127
# Instead, we repeat the latter parts of `lower()` here.
@@ -135,7 +135,7 @@ function eval_macro_name(ctx, ex)
135135
eval(mod, expr_form)
136136
end
137137

138-
function expand_macro(ctx, ex)
138+
function expand_macro(ctx::MacroExpansionContext, ex::SyntaxTree)
139139
@assert kind(ex) == K"macrocall"
140140

141141
macname = ex[1]

0 commit comments

Comments
 (0)