liquidev / euwren

High-level Wren wrapper for Nim
MIT License
36 stars 0 forks source link

Foreign types are not supported as return types from foreign procs #7

Closed liquidev closed 4 years ago

liquidev commented 4 years ago

This won't work:

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.

liquidev commented 4 years ago

Implemented in 0.7.0.