# module A
TPaulinaContext* = object
dpy: PDisplay
rootwin: TWindow
......
template step*(c: TPaulinaContext, onWake: stmt): bool =
bind XNextEvent
bind paulina.TPaulinaContext
proc templ_step():bool =
if XNextEvent(c.dpy, addr(c.e)) != 0: # -- here compiler fails to accessc.dpy, c.e
echo "XNextEvent failed"
return false
#module b
step(c):
echo("awaken")
This code does not compile because of fields of TPaulinaContext are not marked with star and thus not accessible on template instantiation from module B. How can I mark object fields accessible from within template only?