JVM_IR: Respect -Xno-param-assertions
This commit is contained in:
committed by
Alexander Udalov
parent
dd20b74030
commit
da8fb3a195
+3
@@ -184,6 +184,9 @@ class ExpressionCodegen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun generateNonNullAssertions() {
|
private fun generateNonNullAssertions() {
|
||||||
|
if (state.isParamAssertionsDisabled)
|
||||||
|
return
|
||||||
|
|
||||||
val isSyntheticOrBridge = irFunction.origin.isSynthetic ||
|
val isSyntheticOrBridge = irFunction.origin.isSynthetic ||
|
||||||
// Although these are accessible from Java, the functions they bridge to already have the assertions.
|
// Although these are accessible from Java, the functions they bridge to already have the assertions.
|
||||||
irFunction.origin == IrDeclarationOrigin.BRIDGE_SPECIAL ||
|
irFunction.origin == IrDeclarationOrigin.BRIDGE_SPECIAL ||
|
||||||
|
|||||||
-1
@@ -1,5 +1,4 @@
|
|||||||
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS, +JVM.DISABLE_CALL_ASSERTIONS
|
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS, +JVM.DISABLE_CALL_ASSERTIONS
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
// FILE: A.java
|
// FILE: A.java
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|||||||
-1
@@ -1,5 +1,4 @@
|
|||||||
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
|
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
|
|
||||||
class A {
|
class A {
|
||||||
fun foo(s: String) {
|
fun foo(s: String) {
|
||||||
|
|||||||
-1
@@ -1,5 +1,4 @@
|
|||||||
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
|
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
|
|
||||||
class A<T> {
|
class A<T> {
|
||||||
fun add(element: T) {}
|
fun add(element: T) {}
|
||||||
|
|||||||
Vendored
-1
@@ -1,5 +1,4 @@
|
|||||||
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
|
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
|
||||||
// IGNORE_BACKEND: JVM_IR
|
|
||||||
|
|
||||||
fun <T> foo(a: List<T>) {
|
fun <T> foo(a: List<T>) {
|
||||||
val t: T = a.get(0)
|
val t: T = a.get(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user