FedericoCeratto / nim-fswatch

Nim wrapper for the fswatch library
GNU General Public License v3.0
8 stars 1 forks source link

undeclared identifier: 'data' when using setCallback template #4

Open benob opened 2 years ago

benob commented 2 years ago

setCallback assumes the existence of a data variable which is passed to the callback: https://github.com/FedericoCeratto/nim-fswatch/blob/60d5190328d019cd53bc7ea58c3252db5036b4c7/fswatch.nim#L110

A temporary fix is to declare a variable named data in the scope where setCallback is called.

var data = ""
monitor.setCallback(callback)