Skip to content

Commit

Permalink
Do not insert Nothing handling in JvmStatic wrapper.
Browse files Browse the repository at this point in the history
Fixes KT-46568.

(cherry picked from commit 3db5ba9)
  • Loading branch information
madsager authored and Space committed May 18, 2021
1 parent e6966d2 commit 40ced5a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private fun IrFunction.isStaticInlineClassReplacementDelegatingCall(): Boolean =

private val BRIDGE_ORIGINS = setOf(
IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER,
JvmLoweredDeclarationOrigin.JVM_STATIC_WRAPPER,
JvmLoweredDeclarationOrigin.JVM_OVERLOADS_WRAPPER,
JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR,
JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR_FOR_HIDDEN_CONSTRUCTOR,
Expand Down
18 changes: 18 additions & 0 deletions compiler/testData/codegen/box/jvmStatic/kt46568.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME

abstract class Foo {
companion object {
@JvmStatic
fun bar(): Nothing = TODO()
}
}

fun box(): String {
try {
Foo.bar()
} catch (e: Throwable) {
return "OK"
}
return "FAIL"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 40ced5a

Please sign in to comment.