I'm currently using the dana wasm SDK in a project and ran into an issue with the adaptation API while following the example from the runtime adaptation guide:https://www.projectdana.com/dana/guide/runtime_adaptation
I'm using the RecursiveLoader as described here:https://www.projectdana.com/dana/guide/dynamic_loading
The relevant part of my code is:
LoadedComponents lc1 = loader.load("Main.o")
IDC loopComponent = lc1.mainComponent
LoadedComponents lc3 = loader.load("ListProxy.o")
IDC remoteList = lc3.mainComponent
MainLoop loop = new MainLoop() from loopComponent
MainLoop requires the List interface, and both List.o and ListProxy.o provide List.
The initial composition using List.o works correctly. However, when I try to replace the current List implementation with ListProxy.o:
adapt.adaptRequiredInterface(loopComponent, "List", remoteList)
I get the following runtime error:
Uncaught RuntimeError: table index is out of bounds
followed by a stack trace in dana.wasm.
I also tried leaving AdaptEvents:inactive() and AdaptEvents:active() empty, but the same error still occurs, so the issue seems to happen during the adaptation itself rather than in those callbacks.
I'm wondering whether there is any limitation or missing step when using adaptRequiredInterface() with the WASM SDK, or whether this is expected to work the same way as in the native runtime.
Thanks!
