wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps
https://wurstlang.org
Apache License 2.0
225 stars 30 forks source link

[Lua] Reflection natives are not implemented in lua backend #1051

Open jlfarris91 opened 2 years ago

jlfarris91 commented 2 years ago

image

image

image

jlfarris91 commented 2 years ago

After discussing with @peq and @Frotty it makes sense that instanceCount() and maxInstanceCount() would be challenging to implement in lua. Though, I suspect that maxTypeId and typeIdToTypeName implementations are reasonable.

I request that all of these functions are implemented with stub functions being implemented for instanceCount and maxInstanceCount that return 0.

I believe this would be more correct such that maps built using these standard library functions won't fail due to lack of implementation but, at least for the stub functions, would have "undefined" behavior as implied by the contract defined by the warning comment in the Reflection package.