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
[TypeCheckMacros] Never associate MacroExpansionExpr with a closure
The closures are type-checked after macros are expanded
which means that macro cannot reference any declarations
from inner or outer closures as its arguments.
For example:
`_: (Int) -> Void = { x in { @macro(x) in ... }() }`
`x` is not going to be type-checked at macro expansion
time and cannot be referenced by `@Macro`.
Let's walk up declaration contexts until we find first
non-closure one. This means that we can support a local
declaration that is defined inside of a closure because
they are separately checked after outer ones are already
processed.
0 commit comments