Hello folks,
I apologize in advance if this is a silly question as I'm new to nim, but I'm bumping my head against this to no avail for a bit, so here it goes. I have the following snippet:
import std/tables
type
CallbackRegistry = object
table: Table[string, Callback]
Callback = proc (id, arguments: string) {.gcsafe.}
proc registerCallback(registry: var CallbackRegistry) {.base, raises: [].} =
proc callback(id, arguments: string) {.gcsafe.} =
echo "callback called with id: ", id, " and arguments: ", arguments
registry.table["someCallback"] = callback
if I try to compile it with nim 1.6.16 (which is the version my team uses), I get:
Error: registry.table["someCallback"] = callback can raise an unlisted exception: Exception
if I add a raises:[] effect to Callback type; i.e., I declare the type as Callback = proc(id, arguments: string) {.gcsafe.}, then this compiles. It also compiles without issues under nim 2.0.0, further complicating the puzzle. Am I missing anything obvious here?
Thanks!