Merge pull request #9681 from smowton/smowton/fix/reintroduce-obinit

Kotlin: reintroduce obinit when we have multiple secondary constructors and no primary
This commit is contained in:
Chris Smowton
2022-06-24 10:25:24 +01:00
committed by GitHub
5 changed files with 82 additions and 3 deletions

View File

@@ -0,0 +1,2 @@
| test.kt:3:20:3:32 | new KProperty1<Test,Integer>(...) { ... } | test.kt:3:20:3:32 | ...::... |
| test.kt:3:28:3:32 | new Function0<Integer>(...) { ... } | test.kt:3:28:3:32 | ...->... |

View File

@@ -0,0 +1,12 @@
public class Test {
val lazyVal: Int by lazy { 5 }
// Both of these constructors will need to extract the implicit classes created by `lazyVal` and initialize it--
// This test checks we don't introduce any inconsistency this way.
constructor(x: Int) { }
constructor(y: String) { }
}

View File

@@ -0,0 +1,4 @@
import java
from AnonymousClass ac
select ac, ac.getClassInstanceExpr()