Closed kklorenzotesta closed 6 months ago
Should be fixed by https://github.com/BogdanMihaiciuc/ThingTransformer/commit/b4d988aa36912d9693dd39e0d6d5281d0b215d8f
This issue occurred for functions that were defined on the first line in any source file and it didn't matter which file the enum or function were defined in or whether they were dependencies.
When you have time, can you repeat your test with the transformer version in the development
branch? If that solves this for you I will publish a release with the fix and close this issue.
Thanks
I tested it from development and now its working correctly in my code, thank you for the fix!
Fixed in transformer v2.0.2, please reopen if you still have this issue
(But also exists after updating to version 2.0.1) Similar to issue #66 , when an enum is used in a function called by a function, and the enum is declared in a different file (doesn't matter if the file is before or after alphabetically in this case) the enum value is not copied, leading to runtime errors. A full ready to use example that reproduces the issue is on the same fork: github.com/kklorenzotesta/ThingworxVSCodeProjectFunctionsOrderBug
In this example I have this files:
and
In both ThingA and ThingB the service test is transpiled as:
Which fails at runtime since MyEnum doesn't exist for Thingworx.
If I move the enum definition in the same file as ThingB then all services are correctly compiled as: