templates can access hidden fields
This commit is contained in:
parent
4d01408a46
commit
9e92455a53
6 changed files with 61 additions and 42 deletions
9
tests/templates/mcan_access_hidden_field.nim
Normal file
9
tests/templates/mcan_access_hidden_field.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
type
|
||||
Foo* = object
|
||||
fooa, foob: int
|
||||
|
||||
proc createFoo*(a, b: int): Foo = Foo(fooa: a, foob: b)
|
||||
|
||||
template geta*(f: Foo): expr = f.fooa
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue