Ahaaa, so the private nature of the object properties apply to the module they
are used in? That makes more sense to me then. Thanks @Stefan_Salewski and
@lscrd
Marking the type as exported is not sufficient. You have to mark the field pos
as exported (and also for the field dir I guess):
import nico/vec
type
GameObject* = ref object of RootObj
pos*: Vec2i
Player* = ref object of GameObject
dir*: i
You have to mark pos field in GameObject with a star also to make it accessible
from your main.nim module. Unless you do that, it is considered not public, but
private to types.nim module.
Hello there. I am getting a really confusing error message.
"Error: attempting to call undeclared routine: 'pos='"
when doing this (shortened down to relevant bits, code is based on nico
examples):
main.nim
import types
proc newPlayer(x,y: int): Player =
result