Re: [help] indirectly imported types not working?

2018-12-10 Thread jorgeer
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

Re: [help] indirectly imported types not working?

2018-12-09 Thread 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

Re: [help] indirectly imported types not working?

2018-12-09 Thread Stefan_Salewski
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.

[help] indirectly imported types not working?

2018-12-09 Thread jorgeer
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