privateAccess now works with ref | ptr (#17760)

This commit is contained in:
Timothee Cour 2021-04-18 15:15:58 -07:00 • committed by GitHub
commit 0a10af5a2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 149 additions and 15 deletions

View file

@ -17,7 +17,7 @@ when defined(nimImportutilsExample):
x1: int # private
proc initFoo*(): auto = Foo()
proc privateAccess*(t: typedesc) {.magic: "PrivateAccess".} =
proc privateAccess*(t: typedesc[object|ref|ptr]) {.magic: "PrivateAccess".} =
## Enables access to private fields of `t` in current scope.
runnableExamples("-d:nimImportutilsExample"):
# here we're importing a module containing: