Open krzema12 opened 2 years ago
Related fix on the JS side: https://youtrack.jetbrains.com/issue/KT-51127#focus=Comments-27-5940910.0-0 / https://github.com/jetbrains/kotlin/commit/51bb548aefc5a536dfaa540357964eb4fbd0391c (remove Unit_getInstance calls in statements)
Originally created by @SerVB.
If it's just
Unit
, just return Python'sNone
; if it's nullable (Unit?
), then do some more complex logic likenull
->None
andUnit
->Unit.getInstance()
. However doing this will also require being careful withUnit
assignments, for example, if there is code likeval b = println()
, it should be compiled likeprintln(); val b = Unit
(achievable via introducing an extra lowering) becauseprintln()
will returnNone
and it's not what we want to assign tob
.