You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/bindings.jl
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,8 @@ function mark_bindings!(x::EXPR, state)
59
59
mark_sig_args!(x.args[1])
60
60
elseif CSTParser.iscurly(x.args[1])
61
61
mark_typealias_bindings!(x)
62
+
elseifis_in_noneval_macrocall(x.args[1])
63
+
return
62
64
elseif!is_getfield(x.args[1])
63
65
mark_binding!(x.args[1], x)
64
66
end
@@ -156,8 +158,8 @@ function mark_parameters(sig::EXPR, params = String[])
156
158
for i =2:length(sig.args)
157
159
x =mark_binding!(sig.args[i])
158
160
ifbindingof(x) isa Binding &&valof(bindingof(x).name) in params
159
-
# Don't mark a new binding if a parameter has already been
160
-
# introduced from a :where
161
+
# Don't mark a new binding if a parameter has already been
162
+
# introduced from a :where
161
163
x.meta.binding =nothing
162
164
end
163
165
end
@@ -259,7 +261,7 @@ end
259
261
260
262
Add the binding of `x` to the current scope. Special handling is required for:
261
263
* macros: to prefix the `@`
262
-
* functions: These are added to the top-level scope unless this syntax is used to define a closure within a function. If a function with the same name already exists in the scope then it is not replaced. This enables the `refs` list of the Binding of that 'root method' to hold a method table, the name of the new function will resolve to the binding of the root method (to get a list of actual methods -`[get_method(ref) for ref in binding.refs if get_method(ref) !== nothing]`). For example
264
+
* functions: These are added to the top-level scope unless this syntax is used to define a closure within a function. If a function with the same name already exists in the scope then it is not replaced. This enables the `refs` list of the Binding of that 'root method' to hold a method table, the name of the new function will resolve to the binding of the root method (to get a list of actual methods -`[get_method(ref) for ref in binding.refs if get_method(ref) !== nothing]`). For example
263
265
```julia
264
266
[1] f() = 1
265
267
[2] f(x) = 2
@@ -302,14 +304,14 @@ function add_binding(x, state, scope=state.scope)
0 commit comments