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
## Summary
In typed AST, address-of operations are now *always* represented by
`nkAddr` trees. This simplifies some compiler logic, makes processing
for typed macros easier, and fixes an effect tracking bug with `addr`.
## Details
This is effectively a revert of
nim-lang/Nim#10814.
Not turning calls to `mAddr` into `nkAddr` was done to prevent the
unsafe address semantics from being lost, but those no longer exist.
Lowering the call into an `nkAddr` tree has the benefit that it
simplifies AST analysis and processing, as address-of operation can now
always be detected by `PNode.kind == nkAddr`. Old code for detecting
`mAddr` magic calls is removed.
The effect tracking in `sempass2` had no special case for `mAddr`
calls, thus treating them as normal calls, which led to `addr(x)` being
treated as an indirect invocation of `x`, when `x` is of procedural
type. With the `mAddr` call now being lowered earlier, this is no
longer the case.
0 commit comments