first steps to allow easy functors via macros
This commit is contained in:
parent
42c9bb3ace
commit
c59bc0cc18
5 changed files with 65 additions and 20 deletions
19
tests/fields/timplicitfieldswithpartial.nim
Normal file
19
tests/fields/timplicitfieldswithpartial.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
out: '''(foo0: 38, other1: string here)
|
||||
43'''
|
||||
"""
|
||||
|
||||
type
|
||||
Base = ref object of RootObj
|
||||
Foo {.partial.} = ref object of Base
|
||||
|
||||
proc my(f: Foo) =
|
||||
#var f.next = f
|
||||
let f.foo = 38
|
||||
let f.other = "string here"
|
||||
echo f[]
|
||||
echo f.foo0 + 5
|
||||
|
||||
var g: Foo
|
||||
new(g)
|
||||
my(g)
|
||||
Loading…
Add table
Add a link
Reference in a new issue