Files
kotlin-fork/idea/testData/debugger/breakpointApplicability/inlineOnly.kt
T
Yan Zhulanow 780c0518e5 Debugger: Disallow breakpoints for @InlineOnly function bodies (KT-32687, KT-24408)
Kotlin compiler strips all debug information for @InlineOnly functions, making them non-debuggable.
This commit disables breakpoints inside @InlineOnly functions to prevent false expectations.
2019-08-07 01:15:28 +09:00

53 lines
1.0 KiB
Kotlin
Vendored

fun foo() {
require(true) { "foo" } /// *, L, λ
require(true) { val a = 5 } /// *, L, λ
require(true) { /// L
val a = 5 /// L
} /// L
block { val a = 5 } /// *, L, λ
block { /// L
val a = 5 /// L
} /// L
inlineBlock { val a = 5} /// *, L, λ
inlineBlock { /// L
val a = 5 /// L
} /// L
inlineOnlyBlock { val a = 5 } /// *, L, λ
inlineOnlyBlock { /// L
val a = 5 /// L
} /// L
inlineOnlyBlock2 { val a = 5 } /// *, L, λ
inlineOnlyBlock2 { /// L
val a = 5 /// L
} /// L
} /// L
private fun block(block: () -> Unit) { /// M
block() /// L
} /// L
private inline fun inlineBlock(block: () -> Unit) { /// M
block() /// L
} /// L
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
private inline fun inlineOnlyBlock(block: () -> Unit) {
block()
}
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.InlineOnly
private inline fun inlineOnlyBlock2(noinline block: () -> Unit) {
block()
}