This is my code : https://pastebin.com/4yXkW53z
My error is :
- ... IslandWars.nim(41, 12) Error: type mismatch: got <ConvexShape, Texture>
- ... but expected one of: ... proc setTexture(sprite: Sprite; texture: Texture; resetRect: BoolInt) ... first type mismatch at position: 1 ... required type: Sprite ... but expression 'blk' is of type: ConvexShape ... proc setTexture(shape: ConvexShape; texture: Texture; resetRect: BoolInt) ... first type mismatch at position: 3 ... required type: BoolInt ... proc setTexture(shape: Shape; texture: Texture; resetRect: BoolInt) ... first type mismatch at position: 1 ... required type: Shape ... but expression 'blk' is of type: ConvexShape ... proc setTexture(shape: CircleShape; texture: Texture; resetRect: BoolInt) ... first type mismatch at position: 1 ... required type: CircleShape ... but expression 'blk' is of type: ConvexShape ... proc setTexture(shape: RectangleShape; texture: Texture; resetRect: BoolInt) ... first type mismatch at position: 1 ... required type: RectangleShape ... but expression 'blk' is of type: ConvexShape ... expression: setTexture(blk, grass)
The same version in C++ works very well though
I get this error:
scratch.nim(41, 12) Error: type mismatch: got <ConvexShape, Texture>
but expected one of:
proc setTexture(shape: ConvexShape; texture: Texture; resetRect: BoolInt)
first type mismatch at position: 3
required type: BoolInt
4 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
expression: setTexture(blk, grass)
So I read it and use this code instead: blk.setTexture(grass, true) and it compiles.