Hello,
I am doing a simple test with tables and have problems using import.
I have a file Image.nim:
type
Image* = ref object of RootObj
filepath*: string
And a main file:
import tables
import Image
var imgTable: Table[string, Image]
imgTable["hello"] = Image(filepath: "world")
echo imgTable["hello"].filepath
When compiling I have the following issue:
main.nim(6, 9) Error: type mismatch: got <Table[system.string, void], string, Image>
Why my value type is recognized as void ? Image type seems to be recognized...
I am using nim 1.2.0
Yes it works that way, thanks!
But it is strange the type can be created but cannot be recognized in as the Table value type, isn't it ?
Ok, I also tried replacing this line:
var imgTable: Table[string, Image]
by this one:
var imgTable: Table[string, Image.Image]
And it still gives the same error.
Anyway I will change the module names
I think try to make module names plural by convention as well, in the standard library the module containing Table is tables.
I would name the module images