JVM_IR: Respect -Xno-param-assertions

This commit is contained in:
Steven Schäfer
2019-07-02 10:14:56 +02:00
committed by Alexander Udalov
parent dd20b74030
commit da8fb3a195
5 changed files with 3 additions and 4 deletions
@@ -184,6 +184,9 @@ class ExpressionCodegen(
}
private fun generateNonNullAssertions() {
if (state.isParamAssertionsDisabled)
return
val isSyntheticOrBridge = irFunction.origin.isSynthetic ||
// Although these are accessible from Java, the functions they bridge to already have the assertions.
irFunction.origin == IrDeclarationOrigin.BRIDGE_SPECIAL ||
@@ -1,5 +1,4 @@
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS, +JVM.DISABLE_CALL_ASSERTIONS
// IGNORE_BACKEND: JVM_IR
// FILE: A.java
import org.jetbrains.annotations.NotNull;
@@ -1,5 +1,4 @@
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
// IGNORE_BACKEND: JVM_IR
class A {
fun foo(s: String) {
@@ -1,5 +1,4 @@
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
// IGNORE_BACKEND: JVM_IR
class A<T> {
fun add(element: T) {}
@@ -1,5 +1,4 @@
// KOTLIN_CONFIGURATION_FLAGS: +JVM.DISABLE_PARAM_ASSERTIONS
// IGNORE_BACKEND: JVM_IR
fun <T> foo(a: List<T>) {
val t: T = a.get(0)