beef331 / nimscripter

Quick and easy Nim <-> Nimscript interop
MIT License
148 stars 8 forks source link

vmconversion doesn't like std/pegs #21

Closed elcritch closed 1 year ago

elcritch commented 1 year ago

I have a type that has a Peg object in it. When trying to pass it between the vm and code it errors. It's a bit of an odd error:

/Users/jaremycreechley/projs/nims/cimporter/src/cimporter.nim(200, 38) template/generic instantiation of `implNimscriptModule` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/nimble/pkgs/nimscripter-1.0.17/nimscripter/expose.nim(94, 26) template/generic instantiation of `fromVm` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/nimble/pkgs/nimscripter-1.0.17/nimscripter/vmconversion.nim(292, 15) template/generic instantiation of `fromVmImpl` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/nimble/pkgs/nimscripter-1.0.17/nimscripter/vmconversion.nim(175, 28) template/generic instantiation of `fromVm` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/nimble/pkgs/nimscripter-1.0.17/nimscripter/vmconversion.nim(97, 25) template/generic instantiation of `fromVm` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/nimble/pkgs/nimscripter-1.0.17/nimscripter/vmconversion.nim(292, 15) template/generic instantiation of `fromVmImpl` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/nimble/pkgs/nimscripter-1.0.17/nimscripter/vmconversion.nim(175, 28) template/generic instantiation of `fromVm` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/nimble/pkgs/nimscripter-1.0.17/nimscripter/vmconversion.nim(292, 15) template/generic instantiation of `fromVmImpl` from here
/Users/jaremycreechley/.asdf/installs/nim/1.6.10/lib/pure/pegs.nim(81, 31) Error: expression 'typeof(obj)(kind: kind)' is of type 'Peg' and has to be used (or discarded)
beef331 commented 1 year ago

Can you compile with --expandMacro:fromVmImpl and post the generated conversion procedure? Or provide a single file minimal reproduction.

elcritch commented 1 year ago

I'll try and do this today. I want to update ants, so it'd be a good time.