From 570deb10d33da581f1dc61c189ab04ed6c6d470f Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:33:54 +0800 Subject: [PATCH] deprecate `owner` from `std/macros` (#23828) --- changelog.md | 2 ++ lib/core/macros.nim | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index d2332dd57c..75b848ebd1 100644 --- a/changelog.md +++ b/changelog.md @@ -19,6 +19,8 @@ - JS backend now supports lambda lifting for closures. Use `--legacy:jsNoLambdaLifting` to emulate old behavior. +- `owner` in `std/macros` is deprecated. + ## Standard library additions and changes [//]: # "Changes:" diff --git a/lib/core/macros.nim b/lib/core/macros.nim index bd1de9cd7f..d391bf7619 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -277,7 +277,7 @@ when (NimMajor, NimMinor, NimPatch) >= (1, 3, 5) or defined(nimSymImplTransform) ## note that code transformations are implementation dependent and subject to change. ## See an example in `tests/macros/tmacros_various.nim`. -proc owner*(sym: NimNode): NimNode {.magic: "SymOwner", noSideEffect.} +proc owner*(sym: NimNode): NimNode {.magic: "SymOwner", noSideEffect, deprecated.} ## Accepts a node of kind `nnkSym` and returns its owner's symbol. ## The meaning of 'owner' depends on `sym`'s `NimSymKind` and declaration ## context. For top level declarations this is an `nskModule` symbol,