Piotr Krzemiński
07/21/2021, 7:27 AMvisitField(declaration: IrField...
, branch translate-field-declarations), however it's tricky because in Python to be able to use some function, it has to be first defined. That's why now all box tests fail with:
Traceback (most recent call last):
File "/home/piotr/repos/kotlin-python/python/py.translator/testData/out/codegen/irBox/when/noElseInStatement_v5.py4568195347954504164/consumer.py", line 1, in <module>
from compiled_module import box
File "/home/piotr/repos/kotlin-python/python/py.translator/testData/out/codegen/irBox/when/noElseInStatement_v5.py4568195347954504164/compiled_module.py", line 1356, in <module>
UNDEFINED_RESULT = UNDEFINED_RESULT_init_()
NameError: name 'UNDEFINED_RESULT_init_' is not defined
TODO: I think we need to do a similar thing that is done for JavaScript - move field assignments to the bottom, or reorder stuff in some other smart way. Leaving my work-in-progress change on the branch in case someone wants to tackle this problem. If not, I'll get back to it in a few daysbashor
07/21/2021, 3:23 PMPiotr Krzemiński
07/21/2021, 3:25 PMbashor
07/21/2021, 3:26 PMbashor
07/21/2021, 3:28 PMPiotr Krzemiński
07/22/2021, 4:40 AM-Xir-property-lazy-initialization
compiler flag is set. Also fun fact: it was me who reported a bug with incorrect ordering 3 years ago, so glad to see it being addressed 😄 https://youtrack.jetbrains.com/issue/KT-25796