diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt index 13012a726cbf6..2d06308f97911 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt @@ -21,15 +21,19 @@ public class OK /* TARGET use-site */ .#o /* TARGET use-site */ .( = "O") /* TARGET use-site */ .#o - /* TARGET use-site */ .#k - /* TARGET use-site */ .#k + local class + public fun run() + /* TARGET use-site */ .#k + /* TARGET use-site */ .#k /* TARGET use-site */ .() internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this, = "O") /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) + local class + public fun run() + /* ACCESSOR use-site */ access$$p($this = this) + /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this) /* ACCESSOR declaration */ internal /* static */ fun access$($this: OK): String /* TARGET use-site */ $this.() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt b/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt index d8629f44f7686..3b4a1224fb588 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt @@ -21,15 +21,19 @@ public class OK /* TARGET use-site */ .#o /* TARGET use-site */ .( = "O") /* TARGET use-site */ .#o - /* TARGET use-site */ .#k - /* TARGET use-site */ .#k + local class + public fun run() + /* TARGET use-site */ .#k + /* TARGET use-site */ .#k /* TARGET use-site */ .() internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this, = "O") /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) + local class + public fun run() + /* ACCESSOR use-site */ access$$p($this = this) + /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this) /* ACCESSOR declaration */ public /* static */ fun access$($this: OK): String /* TARGET use-site */ $this.() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt b/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt index a238e4c58d9ae..dfeb66439e692 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt @@ -11,11 +11,22 @@ class OK { x = "X" if (!::x.isInitialized) throw Error("Property 'x' is not initialized") - if (::y.isInitialized) throw Error("Property 'y' already initialized") - y = "Y" - if (!::y.isInitialized) throw Error("Property 'y' is not initialized") - - return x + y + object { + fun run() { + if (::y.isInitialized) throw Error("Property 'y' already initialized") + y = "Y" + if (!::y.isInitialized) throw Error("Property 'y' is not initialized") + } + } + val local = object { + lateinit var xy: String + } + + if (local::xy.isInitialized) throw Error("Property 'xy' already initialized") + local.xy = x + y + if (!local::xy.isInitialized) throw Error("Property 'xy' is not initialized") + + return local.xy } internal fun initializeAndReadXY(): String = doInitializeAndReadXY() @@ -25,11 +36,23 @@ class OK { o = "O" if (!::o.isInitialized) throw Error("Property 'o' is not initialized") - if (::k.isInitialized) throw Error("Property 'k' already initialized") - k = "K" - if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + object { + fun run() { + if (::k.isInitialized) throw Error("Property 'k' already initialized") + k = "K" + if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + } + }.run() + + val local = object { + lateinit var ok: String + } + + if (local::ok.isInitialized) throw Error("Property 'ok' already initialized") + local.ok = o + k + if (!local::ok.isInitialized) throw Error("Property 'ok' is not initialized") - return o + k + return local.ok } internal inline fun initializeAndReadOK(): String = doInitializeAndReadOK() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt index ddc29ed5adf09..8d6a7a7dd830e 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt @@ -21,15 +21,19 @@ public class OK /* TARGET use-site */ .#o /* TARGET use-site */ .( = "O") /* TARGET use-site */ .#o - /* TARGET use-site */ .#k - /* TARGET use-site */ .#k + local class + public fun run() + /* TARGET use-site */ .#k + /* TARGET use-site */ .#k /* TARGET use-site */ .() internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this, = "O") /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) + local class + public fun run() + /* ACCESSOR use-site */ access$$p($this = this) + /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this) /* ACCESSOR declaration */ internal /* static */ fun access$($this: OK): String /* TARGET use-site */ $this.() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt b/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt index bd4c493b93f07..37c24ed0808f4 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt @@ -21,15 +21,19 @@ public class OK /* TARGET use-site */ .#o /* TARGET use-site */ .( = "O") /* TARGET use-site */ .#o - /* TARGET use-site */ .#k - /* TARGET use-site */ .#k + local class + public fun run() + /* TARGET use-site */ .#k + /* TARGET use-site */ .#k /* TARGET use-site */ .() internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this, = "O") /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) + local class + public fun run() + /* ACCESSOR use-site */ access$$p($this = this) + /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this) /* ACCESSOR declaration */ public /* static */ fun access$($this: OK): String /* TARGET use-site */ $this.() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt b/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt index f9b4d0d55e01c..bcc3ff864662d 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt @@ -12,11 +12,22 @@ class OK { x = "X" if (!::x.isInitialized) throw Error("Property 'x' is not initialized") - if (::y.isInitialized) throw Error("Property 'y' already initialized") - y = "Y" - if (!::y.isInitialized) throw Error("Property 'y' is not initialized") + object { + fun run() { + if (::y.isInitialized) throw Error("Property 'y' already initialized") + y = "Y" + if (!::y.isInitialized) throw Error("Property 'y' is not initialized") + } + } + val local = object { + lateinit var xy: String + } - return x + y + if (local::xy.isInitialized) throw Error("Property 'xy' already initialized") + local.xy = x + y + if (!local::xy.isInitialized) throw Error("Property 'xy' is not initialized") + + return local.xy } internal fun initializeAndReadXY(): String = doInitializeAndReadXY() @@ -26,11 +37,23 @@ class OK { o = "O" if (!::o.isInitialized) throw Error("Property 'o' is not initialized") - if (::k.isInitialized) throw Error("Property 'k' already initialized") - k = "K" - if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + object { + fun run() { + if (::k.isInitialized) throw Error("Property 'k' already initialized") + k = "K" + if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + } + }.run() + + val local = object { + lateinit var ok: String + } + + if (local::ok.isInitialized) throw Error("Property 'ok' already initialized") + local.ok = o + k + if (!local::ok.isInitialized) throw Error("Property 'ok' is not initialized") - return o + k + return local.ok } internal inline fun initializeAndReadOK(): String = doInitializeAndReadOK() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt index 083bcddf9b617..efc47841cffe6 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt @@ -21,15 +21,19 @@ public class OK /* TARGET use-site */ .#o /* TARGET use-site */ .( = "O") /* TARGET use-site */ .#o - /* TARGET use-site */ .#k - /* TARGET use-site */ .#k + local class + public fun run() + /* TARGET use-site */ .#k + /* TARGET use-site */ .#k /* TARGET use-site */ .() internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this, = "O") /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) + local class + public fun run() + /* ACCESSOR use-site */ access$$p($this = this) + /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this) /* ACCESSOR declaration */ internal /* static */ fun access$($this: OK): String /* TARGET use-site */ $this.() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt b/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt index c8d81b73853d5..44e0e0ffa1aad 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt @@ -21,15 +21,19 @@ public class OK /* TARGET use-site */ .#o /* TARGET use-site */ .( = "O") /* TARGET use-site */ .#o - /* TARGET use-site */ .#k - /* TARGET use-site */ .#k + local class + public fun run() + /* TARGET use-site */ .#k + /* TARGET use-site */ .#k /* TARGET use-site */ .() internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this, = "O") /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) - /* ACCESSOR use-site */ access$$p($this = this) + local class + public fun run() + /* ACCESSOR use-site */ access$$p($this = this) + /* ACCESSOR use-site */ access$$p($this = this) /* ACCESSOR use-site */ access$($this = this) /* ACCESSOR declaration */ public /* static */ fun access$($this: OK): String /* TARGET use-site */ $this.() diff --git a/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.kt b/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.kt index 3cd15e2c987d5..52dfc36596b1a 100644 --- a/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.kt +++ b/compiler/testData/klib/syntheticAccessors/privateMember/singleFile/useLateinitIsInitializedFromInternalInline.kt @@ -10,11 +10,22 @@ class OK { x = "X" if (!::x.isInitialized) throw Error("Property 'x' is not initialized") - if (::y.isInitialized) throw Error("Property 'y' already initialized") - y = "Y" - if (!::y.isInitialized) throw Error("Property 'y' is not initialized") - - return x + y + object { + fun run() { + if (::y.isInitialized) throw Error("Property 'y' already initialized") + y = "Y" + if (!::y.isInitialized) throw Error("Property 'y' is not initialized") + } + } + val local = object { + lateinit var xy: String + } + + if (local::xy.isInitialized) throw Error("Property 'xy' already initialized") + local.xy = x + y + if (!local::xy.isInitialized) throw Error("Property 'xy' is not initialized") + + return local.xy } internal fun initializeAndReadXY(): String = doInitializeAndReadXY() @@ -24,11 +35,23 @@ class OK { o = "O" if (!::o.isInitialized) throw Error("Property 'o' is not initialized") - if (::k.isInitialized) throw Error("Property 'k' already initialized") - k = "K" - if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + object { + fun run() { + if (::k.isInitialized) throw Error("Property 'k' already initialized") + k = "K" + if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + } + }.run() + + val local = object { + lateinit var ok: String + } + + if (local::ok.isInitialized) throw Error("Property 'ok' already initialized") + local.ok = o + k + if (!local::ok.isInitialized) throw Error("Property 'ok' is not initialized") - return o + k + return local.ok } internal inline fun initializeAndReadOK(): String = doInitializeAndReadOK() diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt index af7b08b92f5a0..e4ce28c6c3c45 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt @@ -20,15 +20,19 @@ private inline fun doInitializeAndReadOK(): String /* TARGET use-site */ #o /* TARGET use-site */ ( = "O") /* TARGET use-site */ #o - /* TARGET use-site */ #k - /* TARGET use-site */ #k + local class + public fun run() + /* TARGET use-site */ #k + /* TARGET use-site */ #k /* TARGET use-site */ () internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt( = "O") /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() + local class + public fun run() + /* ACCESSOR use-site */ access$$p$tOKKt() + /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt() /* ACCESSOR declaration */ internal fun access$$tOKKt(): String /* TARGET use-site */ () diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt index f1f4d62c13ed0..9da9018de3ce1 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt @@ -20,15 +20,19 @@ private inline fun doInitializeAndReadOK(): String /* TARGET use-site */ #o /* TARGET use-site */ ( = "O") /* TARGET use-site */ #o - /* TARGET use-site */ #k - /* TARGET use-site */ #k + local class + public fun run() + /* TARGET use-site */ #k + /* TARGET use-site */ #k /* TARGET use-site */ () internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt( = "O") /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() + local class + public fun run() + /* ACCESSOR use-site */ access$$p$tOKKt() + /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt() /* ACCESSOR declaration */ public fun access$$tOKKt(): String /* TARGET use-site */ () diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt index 50caf6446d630..1bd0566ecb2c1 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt @@ -10,11 +10,22 @@ private inline fun doInitializeAndReadXY(): String { x = "X" if (!::x.isInitialized) throw Error("Property 'x' is not initialized") - if (::y.isInitialized) throw Error("Property 'y' already initialized") - y = "Y" - if (!::y.isInitialized) throw Error("Property 'y' is not initialized") - - return x + y + object { + fun run() { + if (::y.isInitialized) throw Error("Property 'y' already initialized") + y = "Y" + if (!::y.isInitialized) throw Error("Property 'y' is not initialized") + } + } + val local = object { + lateinit var xy: String + } + + if (local::xy.isInitialized) throw Error("Property 'xy' already initialized") + local.xy = x + y + if (!local::xy.isInitialized) throw Error("Property 'xy' is not initialized") + + return local.xy } internal fun initializeAndReadXY(): String = doInitializeAndReadXY() @@ -24,11 +35,23 @@ private inline fun doInitializeAndReadOK(): String { o = "O" if (!::o.isInitialized) throw Error("Property 'o' is not initialized") - if (::k.isInitialized) throw Error("Property 'k' already initialized") - k = "K" - if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + object { + fun run() { + if (::k.isInitialized) throw Error("Property 'k' already initialized") + k = "K" + if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + } + }.run() + + val local = object { + lateinit var ok: String + } + + if (local::ok.isInitialized) throw Error("Property 'ok' already initialized") + local.ok = o + k + if (!local::ok.isInitialized) throw Error("Property 'ok' is not initialized") - return o + k + return local.ok } internal inline fun initializeAndReadOK(): String = doInitializeAndReadOK() diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt new file mode 100644 index 0000000000000..5db86abd83d87 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt @@ -0,0 +1,16 @@ +/* MODULE name=
*/ + +/* FILE package= fileName=A.kt */ + +private lateinit var o: String? + /* TARGET declaration */ private fun (): String + /* TARGET declaration */ private fun (: String) +public class A + internal inline fun inlineMethod(): String + local fun () + /* ACCESSOR use-site */ access$$tAKt( = "O") + /* ACCESSOR use-site */ access$$tAKt() +/* ACCESSOR declaration */ internal fun access$$tAKt(): String + /* TARGET use-site */ () +/* ACCESSOR declaration */ internal fun access$$tAKt(: String) + /* TARGET use-site */ ( = ) diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors.txt new file mode 100644 index 0000000000000..1b3c3936f2cef --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors.txt @@ -0,0 +1,16 @@ +/* MODULE name=
*/ + +/* FILE package= fileName=A.kt */ + +private lateinit var o: String? + /* TARGET declaration */ private fun (): String + /* TARGET declaration */ private fun (: String) +public class A + internal inline fun inlineMethod(): String + local fun () + /* ACCESSOR use-site */ access$$tAKt( = "O") + /* ACCESSOR use-site */ access$$tAKt() +/* ACCESSOR declaration */ public fun access$$tAKt(): String + /* TARGET use-site */ () +/* ACCESSOR declaration */ public fun access$$tAKt(: String) + /* TARGET use-site */ ( = ) diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.kt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.kt new file mode 100644 index 0000000000000..cd7630666f8b1 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.kt @@ -0,0 +1,22 @@ +// IGNORE_BACKEND: JS_IR +// ^^^ This test fails due to visibility violation on access to JS `internal` intrinsic functions +// `kotlin.sharedBoxCreate`, `kotlin.sharedBoxRead` and `kotlin.sharedBoxWrite`. To be fixed in KT-67304. + +// FILE: A.kt +fun wrapper(block: () -> Unit) { block() } + +private lateinit var o: String + +class A { + internal inline fun inlineMethod(): String { + lateinit var k: String + wrapper { + o = "O" + k = "K" + } + return o + k + } +} + +// FILE: main.kt +fun box() = A().inlineMethod() diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt index ac6deadc00a95..2cdb7907943f4 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors-narrowed.txt @@ -6,15 +6,19 @@ internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt( = "O") /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() + local class + public fun run() + /* ACCESSOR use-site */ access$$p$tOKKt() + /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt() private inline fun doInitializeAndReadOK(): String /* TARGET use-site */ #o /* TARGET use-site */ ( = "O") /* TARGET use-site */ #o - /* TARGET use-site */ #k - /* TARGET use-site */ #k + local class + public fun run() + /* TARGET use-site */ #k + /* TARGET use-site */ #k /* TARGET use-site */ () private lateinit var o: String? /* TARGET declaration */ private /* static field */ field o: String? diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt index 8f6d23a493cb3..86a8cd168b78a 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.accessors.txt @@ -6,15 +6,19 @@ internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt( = "O") /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() - /* ACCESSOR use-site */ access$$p$tOKKt() + local class + public fun run() + /* ACCESSOR use-site */ access$$p$tOKKt() + /* ACCESSOR use-site */ access$$p$tOKKt() /* ACCESSOR use-site */ access$$tOKKt() private inline fun doInitializeAndReadOK(): String /* TARGET use-site */ #o /* TARGET use-site */ ( = "O") /* TARGET use-site */ #o - /* TARGET use-site */ #k - /* TARGET use-site */ #k + local class + public fun run() + /* TARGET use-site */ #k + /* TARGET use-site */ #k /* TARGET use-site */ () private lateinit var o: String? /* TARGET declaration */ private /* static field */ field o: String? diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt index 2bcf1b26026bf..11fe98b09d31e 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingLateinitIsInitializedFromInternalInline.kt @@ -11,11 +11,22 @@ private inline fun doInitializeAndReadXY(): String { x = "X" if (!::x.isInitialized) throw Error("Property 'x' is not initialized") - if (::y.isInitialized) throw Error("Property 'y' already initialized") - y = "Y" - if (!::y.isInitialized) throw Error("Property 'y' is not initialized") - - return x + y + object { + fun run() { + if (::y.isInitialized) throw Error("Property 'y' already initialized") + y = "Y" + if (!::y.isInitialized) throw Error("Property 'y' is not initialized") + } + } + val local = object { + lateinit var xy: String + } + + if (local::xy.isInitialized) throw Error("Property 'xy' already initialized") + local.xy = x + y + if (!local::xy.isInitialized) throw Error("Property 'xy' is not initialized") + + return local.xy } internal fun initializeAndReadXY(): String = doInitializeAndReadXY() @@ -25,11 +36,23 @@ private inline fun doInitializeAndReadOK(): String { o = "O" if (!::o.isInitialized) throw Error("Property 'o' is not initialized") - if (::k.isInitialized) throw Error("Property 'k' already initialized") - k = "K" - if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + object { + fun run() { + if (::k.isInitialized) throw Error("Property 'k' already initialized") + k = "K" + if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + } + }.run() + + val local = object { + lateinit var ok: String + } + + if (local::ok.isInitialized) throw Error("Property 'ok' already initialized") + local.ok = o + k + if (!local::ok.isInitialized) throw Error("Property 'ok' is not initialized") - return o + k + return local.ok } internal inline fun initializeAndReadOK(): String = doInitializeAndReadOK() diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt new file mode 100644 index 0000000000000..5fef16a6ce811 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt @@ -0,0 +1,16 @@ +/* MODULE name= */ + +/* FILE package= fileName=A.kt */ + +public class A + internal inline fun inlineMethod(): String + local fun () + /* ACCESSOR use-site */ access$$tAKt( = "O") + /* ACCESSOR use-site */ access$$tAKt() +private lateinit var o: String? + /* TARGET declaration */ private fun (): String + /* TARGET declaration */ private fun (: String) +/* ACCESSOR declaration */ internal fun access$$tAKt(): String + /* TARGET use-site */ () +/* ACCESSOR declaration */ internal fun access$$tAKt(: String) + /* TARGET use-site */ ( = ) diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors.txt new file mode 100644 index 0000000000000..991edc376a160 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.accessors.txt @@ -0,0 +1,16 @@ +/* MODULE name= */ + +/* FILE package= fileName=A.kt */ + +public class A + internal inline fun inlineMethod(): String + local fun () + /* ACCESSOR use-site */ access$$tAKt( = "O") + /* ACCESSOR use-site */ access$$tAKt() +private lateinit var o: String? + /* TARGET declaration */ private fun (): String + /* TARGET declaration */ private fun (: String) +/* ACCESSOR declaration */ public fun access$$tAKt(): String + /* TARGET use-site */ () +/* ACCESSOR declaration */ public fun access$$tAKt(: String) + /* TARGET use-site */ ( = ) diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.kt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.kt new file mode 100644 index 0000000000000..b3095704de0a9 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.kt @@ -0,0 +1,24 @@ +// IGNORE_BACKEND: JS_IR +// ^^^ This test fails due to visibility violation on access to JS `internal` intrinsic functions +// `kotlin.sharedBoxCreate`, `kotlin.sharedBoxRead` and `kotlin.sharedBoxWrite`. To be fixed in KT-67304. + +// MODULE: lib +// FILE: A.kt +fun wrapper(block: () -> Unit) { block() } + +private lateinit var o: String + +class A { + internal inline fun inlineMethod(): String { + lateinit var k: String + wrapper { + o = "O" + k = "K" + } + return o + k + } +} + +// MODULE: main()(lib) +// FILE: main.kt +fun box() = A().inlineMethod() diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt new file mode 100644 index 0000000000000..48fafa554be56 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.accessors-narrowed.txt @@ -0,0 +1,16 @@ +/* MODULE name=
*/ + +/* FILE package= fileName=leakingPrivateTopLevelLateinitVar.kt */ + +private lateinit var o: String? + /* TARGET declaration */ private fun (): String + /* TARGET declaration */ private fun (: String) +public class A + internal inline fun inlineMethod(): String + local fun () + /* ACCESSOR use-site */ access$$tLeakingPrivateTopLevelLateinitVarKt( = "O") + /* ACCESSOR use-site */ access$$tLeakingPrivateTopLevelLateinitVarKt() +/* ACCESSOR declaration */ internal fun access$$tLeakingPrivateTopLevelLateinitVarKt(): String + /* TARGET use-site */ () +/* ACCESSOR declaration */ internal fun access$$tLeakingPrivateTopLevelLateinitVarKt(: String) + /* TARGET use-site */ ( = ) diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.accessors.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.accessors.txt new file mode 100644 index 0000000000000..4db2762190847 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.accessors.txt @@ -0,0 +1,16 @@ +/* MODULE name=
*/ + +/* FILE package= fileName=leakingPrivateTopLevelLateinitVar.kt */ + +private lateinit var o: String? + /* TARGET declaration */ private fun (): String + /* TARGET declaration */ private fun (: String) +public class A + internal inline fun inlineMethod(): String + local fun () + /* ACCESSOR use-site */ access$$tLeakingPrivateTopLevelLateinitVarKt( = "O") + /* ACCESSOR use-site */ access$$tLeakingPrivateTopLevelLateinitVarKt() +/* ACCESSOR declaration */ public fun access$$tLeakingPrivateTopLevelLateinitVarKt(): String + /* TARGET use-site */ () +/* ACCESSOR declaration */ public fun access$$tLeakingPrivateTopLevelLateinitVarKt(: String) + /* TARGET use-site */ ( = ) diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.kt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.kt new file mode 100644 index 0000000000000..ff3ec4673b2d0 --- /dev/null +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.kt @@ -0,0 +1,20 @@ +// IGNORE_BACKEND: JS_IR +// ^^^ This test fails due to visibility violation on access to JS `internal` intrinsic functions +// `kotlin.sharedBoxCreate`, `kotlin.sharedBoxRead` and `kotlin.sharedBoxWrite`. To be fixed in KT-67304. + +fun wrapper(block: () -> Unit) { block() } + +private lateinit var o: String + +class A { + internal inline fun inlineMethod(): String { + lateinit var k: String + wrapper { + o = "O" + k = "K" + } + return o + k + } +} + +fun box() = A().inlineMethod() diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt index 848202e19e449..54ddd506891de 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors-narrowed.txt @@ -20,15 +20,19 @@ private inline fun doInitializeAndReadOK(): String /* TARGET use-site */ #o /* TARGET use-site */ ( = "O") /* TARGET use-site */ #o - /* TARGET use-site */ #k - /* TARGET use-site */ #k + local class + public fun run() + /* TARGET use-site */ #k + /* TARGET use-site */ #k /* TARGET use-site */ () internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() /* ACCESSOR use-site */ access$$tUseLateinitIsInitializedFromInternalInlineKt( = "O") /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() - /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() - /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() + local class + public fun run() + /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() + /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() /* ACCESSOR use-site */ access$$tUseLateinitIsInitializedFromInternalInlineKt() /* ACCESSOR declaration */ internal fun access$$tUseLateinitIsInitializedFromInternalInlineKt(): String /* TARGET use-site */ () diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt index ecf75651f58af..5c5a45eb9d4d5 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.accessors.txt @@ -20,15 +20,19 @@ private inline fun doInitializeAndReadOK(): String /* TARGET use-site */ #o /* TARGET use-site */ ( = "O") /* TARGET use-site */ #o - /* TARGET use-site */ #k - /* TARGET use-site */ #k + local class + public fun run() + /* TARGET use-site */ #k + /* TARGET use-site */ #k /* TARGET use-site */ () internal inline fun initializeAndReadOK(): String /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() /* ACCESSOR use-site */ access$$tUseLateinitIsInitializedFromInternalInlineKt( = "O") /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() - /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() - /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() + local class + public fun run() + /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() + /* ACCESSOR use-site */ access$$p$tUseLateinitIsInitializedFromInternalInlineKt() /* ACCESSOR use-site */ access$$tUseLateinitIsInitializedFromInternalInlineKt() /* ACCESSOR declaration */ public fun access$$tUseLateinitIsInitializedFromInternalInlineKt(): String /* TARGET use-site */ () diff --git a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.kt b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.kt index 383ab95477e67..f353ef3288d90 100644 --- a/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.kt +++ b/compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/useLateinitIsInitializedFromInternalInline.kt @@ -9,11 +9,23 @@ private inline fun doInitializeAndReadXY(): String { x = "X" if (!::x.isInitialized) throw Error("Property 'x' is not initialized") - if (::y.isInitialized) throw Error("Property 'y' already initialized") - y = "Y" - if (!::y.isInitialized) throw Error("Property 'y' is not initialized") - - return x + y + object { + fun run() { + if (::y.isInitialized) throw Error("Property 'y' already initialized") + y = "Y" + if (!::y.isInitialized) throw Error("Property 'y' is not initialized") + } + }.run() + + val local = object { + lateinit var xy: String + } + + if (local::xy.isInitialized) throw Error("Property 'xy' already initialized") + local.xy = x + y + if (!local::xy.isInitialized) throw Error("Property 'xy' is not initialized") + + return local.xy } internal fun initializeAndReadXY(): String = doInitializeAndReadXY() @@ -23,11 +35,23 @@ private inline fun doInitializeAndReadOK(): String { o = "O" if (!::o.isInitialized) throw Error("Property 'o' is not initialized") - if (::k.isInitialized) throw Error("Property 'k' already initialized") - k = "K" - if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + object { + fun run() { + if (::k.isInitialized) throw Error("Property 'k' already initialized") + k = "K" + if (!::k.isInitialized) throw Error("Property 'k' is not initialized") + } + }.run() + + val local = object { + lateinit var ok: String + } + + if (local::ok.isInitialized) throw Error("Property 'ok' already initialized") + local.ok = o + k + if (!local::ok.isInitialized) throw Error("Property 'ok' is not initialized") - return o + k + return local.ok } internal inline fun initializeAndReadOK(): String = doInitializeAndReadOK() diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase1TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase1TestGenerated.java index 8e37bcdb4dd9c..0564a2721ba13 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase1TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase1TestGenerated.java @@ -1173,6 +1173,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1363,6 +1369,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1451,6 +1463,12 @@ public void testAllFilesPresentInSingleFile() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("useLateinitIsInitializedFromInternalInline.kt") public void testUseLateinitIsInitializedFromInternalInline() { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase2TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase2TestGenerated.java index 94d58dc6ce45c..4e20acee295cd 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase2TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsKlibSyntheticAccessorInPhase2TestGenerated.java @@ -1173,6 +1173,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1363,6 +1369,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1451,6 +1463,12 @@ public void testAllFilesPresentInSingleFile() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("useLateinitIsInitializedFromInternalInline.kt") public void testUseLateinitIsInitializedFromInternalInline() { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase1TestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase1TestGenerated.java index bad9efb24fe12..befef413cad39 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase1TestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase1TestGenerated.java @@ -1233,6 +1233,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1428,6 +1434,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1521,6 +1533,12 @@ public void testAllFilesPresentInSingleFile() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("useLateinitIsInitializedFromInternalInline.kt") public void testUseLateinitIsInitializedFromInternalInline() { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase2TestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase2TestGenerated.java index e29850e5e1fbd..30015a1256c9e 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase2TestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeKlibSyntheticAccessorInPhase2TestGenerated.java @@ -1233,6 +1233,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossFilePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1428,6 +1434,12 @@ public void testLeakingPrivateTopLevelFunWithDifferentVisibility() { runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelFunWithDifferentVisibility.kt"); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/crossModulePrivateLeak/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("leakingPrivateTopLevelSetterThroughInlineFun.kt") public void testLeakingPrivateTopLevelSetterThroughInlineFun() { @@ -1521,6 +1533,12 @@ public void testAllFilesPresentInSingleFile() { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); } + @Test + @TestMetadata("leakingPrivateTopLevelLateinitVar.kt") + public void testLeakingPrivateTopLevelLateinitVar() { + runTest("compiler/testData/klib/syntheticAccessors/topLevelPrivate/singleFile/leakingPrivateTopLevelLateinitVar.kt"); + } + @Test @TestMetadata("useLateinitIsInitializedFromInternalInline.kt") public void testUseLateinitIsInitializedFromInternalInline() {