Skip to content

Instantly share code, notes, and snippets.

@gradha
Created December 16, 2013 23:32
Show Gist options
  • Save gradha/7996913 to your computer and use it in GitHub Desktop.
Save gradha/7996913 to your computer and use it in GitHub Desktop.
type tb_cell = distinct int
proc tb_put_cell(x: cuint; y: cuint; cell: ptr tb_cell) =
echo "Hey"
proc put_cell*(x, y: cuint; cell: var tb_cell) =
tb_put_cell(x, y, cell.addr)
# In application
proc put*(cell: var tb_cell; x, y: int):
tb_put_cell(x.cuint, y.cuint, cell)
# kofish.nim(12, 13) Error: type mismatch: got (cuint, cuint, tb_cell)
# but expected one of:
# kofish.tb_put_cell(x: cuint, y: cuint, cell: ptr tb_cell)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment