type
Test = ref object
var test: Test
proc getTest(): Test = test
wren.foreign("test"):
Procs:
getTest
wren.ready()
wren.run("""
import "test" for Procs
var t = Procs.getTest()
""")
It will fail with a compile error, stating that Test is an unsupported type for slot assignment. Instead, the type should be checked if it's registered in the VM—if not, throw an error.
This won't work:
It will fail with a compile error, stating that
Test
is an unsupported type for slot assignment. Instead, the type should be checked if it's registered in the VM—if not, throw an error.