KT-36336 @EnhancedNullability and null checks

Don't insert implicit null check on a value of @EnhancedNullability type
used where @EnhancedNullability type is expected.

This uncovers a bunch of other problems in FE and BE.
KT-36343 and KT-36347 are bugs in StrictJavaNullabilityAssertions
implementation which should most likely be fixed in next major language
version (with proper breaking change notice).
KT-36344 is a design problem which should be addressed after 1.4 issues
are resolved.
This commit is contained in:
Dmitry Petrov
2020-02-04 15:27:00 +03:00
parent 6489b56fb0
commit ee020ef290
35 changed files with 1216 additions and 121 deletions
@@ -1807,26 +1807,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
runTest("compiler/testData/ir/irText/types/asOnPlatformType.kt");
}
@TestMetadata("enhancedNullability.kt")
public void testEnhancedNullability() throws Exception {
runTest("compiler/testData/ir/irText/types/enhancedNullability.kt");
}
@TestMetadata("explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt")
public void testExplicitEqualsAndCompareToCallsOnPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt");
}
@TestMetadata("genericPropertyReferenceType.kt")
public void testGenericPropertyReferenceType() throws Exception {
runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt");
}
@TestMetadata("implicitNotNullOnPlatformType.kt")
public void testImplicitNotNullOnPlatformType() throws Exception {
runTest("compiler/testData/ir/irText/types/implicitNotNullOnPlatformType.kt");
}
@TestMetadata("intersectionType1_NI.kt")
public void testIntersectionType1_NI() throws Exception {
runTest("compiler/testData/ir/irText/types/intersectionType1_NI.kt");
@@ -1862,16 +1847,6 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt");
}
@TestMetadata("nullabilityAssertionOnExtensionReceiver.kt")
public void testNullabilityAssertionOnExtensionReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullabilityAssertionOnExtensionReceiver.kt");
}
@TestMetadata("platformTypeReceiver.kt")
public void testPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/platformTypeReceiver.kt");
}
@TestMetadata("smartCastOnFakeOverrideReceiver.kt")
public void testSmartCastOnFakeOverrideReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.kt");
@@ -1886,5 +1861,53 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
public void testSmartCastOnReceiverOfGenericType() throws Exception {
runTest("compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt");
}
@TestMetadata("compiler/testData/ir/irText/types/nullChecks")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NullChecks extends AbstractFir2IrTextTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.ANY, testDataFilePath, "// IGNORE_BACKEND_FIR: ");
}
public void testAllFilesPresentInNullChecks() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("enhancedNullability.kt")
public void testEnhancedNullability() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullability.kt");
}
@TestMetadata("enhancedNullabilityInDestructuringAssignment.kt")
public void testEnhancedNullabilityInDestructuringAssignment() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt");
}
@TestMetadata("enhancedNullabilityInForLoop.kt")
public void testEnhancedNullabilityInForLoop() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt");
}
@TestMetadata("explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt")
public void testExplicitEqualsAndCompareToCallsOnPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt");
}
@TestMetadata("implicitNotNullOnPlatformType.kt")
public void testImplicitNotNullOnPlatformType() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt");
}
@TestMetadata("nullabilityAssertionOnExtensionReceiver.kt")
public void testNullabilityAssertionOnExtensionReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.kt");
}
@TestMetadata("platformTypeReceiver.kt")
public void testPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/platformTypeReceiver.kt");
}
}
}
}
@@ -326,10 +326,10 @@ internal class InsertImplicitCasts(
else
implicitCast(expectedType, IrTypeOperator.IMPLICIT_DYNAMIC_CAST)
(valueType.isNullabilityFlexible() && valueType.containsNull()) && !expectedType.containsNull() ->
valueType.isNullabilityFlexible() && valueType.containsNull() && !expectedType.acceptsNullValues() ->
implicitNonNull(valueType, expectedType)
(valueType.hasEnhancedNullability() && !isLambdaReturnValue) && !expectedType.containsNull() ->
(valueType.hasEnhancedNullability() && !isLambdaReturnValue) && !expectedType.acceptsNullValues() ->
implicitNonNull(valueType, expectedType)
KotlinTypeChecker.DEFAULT.isSubtypeOf(valueType, expectedType.makeNullable()) ->
@@ -359,6 +359,9 @@ internal class InsertImplicitCasts(
}
}
private fun KotlinType.acceptsNullValues() =
containsNull() || hasEnhancedNullability()
private fun KotlinType.hasEnhancedNullability() =
generatorExtensions.enhancedNullability.hasEnhancedNullability(this)
@@ -1,13 +1,16 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// WITH_RUNTIME
// Note: This fails on JVM (non-IR) with "Fail: should throw on get() in loop header". The not-null assertion is not generated when
// assigning to the loop variable. The root cause seems to be that the loop variable is a KtParameter and
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on KtParameters.
// Note: this fails on JVM_IR because of KT-36343.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,6 +1,6 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// JVM_TARGET: 1.8
@@ -10,6 +10,9 @@
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on KtParameters.
// See KT-35698.
// Note: this fails on JVM_IR because of KT-36343.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,6 +1,6 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
@@ -8,6 +8,9 @@
// assigning to the loop variable. The root cause seems to be that the loop variable is a KtParameter and
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on KtParameters.
// Note: this fails on JVM_IR because of KT-36343.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,7 +1,7 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// WITH_RUNTIME
// JVM_TARGET: 1.8
@@ -9,6 +9,9 @@
// assigning to the loop variable. The root cause seems to be that the loop variable is a KtParameter and
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on KtParameters.
// Note: this fails on JVM_IR because of KT-36343.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,6 +1,6 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// JVM_TARGET: 1.8
@@ -9,6 +9,9 @@
// assigning to the loop variable. The root cause seems to be that the loop variable is a KtParameter and
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on KtParameters.
// Note: this fails on JVM_IR because of KT-36343.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,6 +1,6 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
@@ -9,6 +9,9 @@
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on
// KtDestructuringDeclarations and their entries.
// Note: this fails on JVM_IR because of KT-36347.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,6 +1,6 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// JVM_TARGET: 1.8
@@ -10,6 +10,9 @@
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on
// KtDestructuringDeclarations and their entries.
// Note: this fails on JVM_IR because of KT-36347.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,6 +1,6 @@
// !LANGUAGE: +StrictJavaNullabilityAssertions
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND: JVM, JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// JVM_TARGET: 1.8
@@ -10,6 +10,9 @@
// CodegenAnnotatingVisitor/RuntimeAssertionsOnDeclarationBodyChecker do not analyze the need for not-null assertions on
// KtDestructuringDeclarations and their entries.
// Note: this fails on JVM_IR because of KT-36347.
// It requires potentially breaking changes in FE, so please, don't touch it until the language design decision.
// FILE: box.kt
import kotlin.test.*
@@ -1,7 +1,9 @@
// FILE: test/CallableDescriptor.java
// IGNORE_BACKEND: JVM_IR
// See KT-35656, here JMV_IR correctly generates a nullability assertion for an argument of 'Iterable<T>.contains(T)'.
// JVM_IR:
// Here in 'original in emptySet<D>()' T = '@EnhancedNullability CallableDescriptor' is inferred for 'Iterable<T>.contains(T)'.
// Using value of '@EnhancedNullability CallableDescriptor' type where '@EnhancedNullability CallableDescriptor' is expected
// doesn't cause a null check.
package test;
@@ -1,31 +0,0 @@
FILE fqName:<root> fileName:/enhancedNullability.kt
FUN name:use visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit
VALUE_PARAMETER name:s index:0 type:kotlin.String
BLOCK_BODY
FUN name:testUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun use (s: kotlin.String): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
s: CALL 'public open fun s (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN name:testLocalVal visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:local type:kotlin.String [val]
CALL 'public open fun s (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN name:testReturnValue visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnValue (): kotlin.String declared in <root>'
CALL 'public open fun s (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
PROPERTY name:testGlobalVal visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:testGlobalVal type:kotlin.String visibility:private [final,static]
EXPRESSION_BODY
CALL 'public open fun s (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-testGlobalVal> visibility:public modality:FINAL <> () returnType:kotlin.String
correspondingProperty: PROPERTY name:testGlobalVal visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-testGlobalVal> (): kotlin.String declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testGlobalVal type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null
PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val]
FUN name:<get-testGlobalValGetter> visibility:public modality:FINAL <> () returnType:kotlin.String
correspondingProperty: PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-testGlobalValGetter> (): kotlin.String declared in <root>'
CALL 'public open fun s (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
@@ -1,23 +0,0 @@
// FILE: enhancedNullability.kt
fun use(s: String) {}
fun testUse() {
use(J.s())
}
fun testLocalVal() {
val local = J.s()
}
fun testReturnValue() = J.s()
val testGlobalVal = J.s()
val testGlobalValGetter get() = J.s()
// FILE: J.java
import org.jetbrains.annotations.*
public class J {
public static @NotNull String s() { return null; }
}
@@ -0,0 +1,47 @@
FILE fqName:<root> fileName:/enhancedNullability.kt
FUN name:use visibility:public modality:FINAL <> (s:kotlin.String) returnType:kotlin.Unit
VALUE_PARAMETER name:s index:0 type:kotlin.String
BLOCK_BODY
FUN name:testUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public final fun use (s: kotlin.String): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
s: CALL 'public open fun notNullString (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN name:testLocalVal visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:local type:kotlin.String [val]
CALL 'public open fun notNullString (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN name:testReturnValue visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnValue (): kotlin.String declared in <root>'
CALL 'public open fun notNullString (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
PROPERTY name:testGlobalVal visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:testGlobalVal type:kotlin.String visibility:private [final,static]
EXPRESSION_BODY
CALL 'public open fun notNullString (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-testGlobalVal> visibility:public modality:FINAL <> () returnType:kotlin.String
correspondingProperty: PROPERTY name:testGlobalVal visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-testGlobalVal> (): kotlin.String declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testGlobalVal type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=null
PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val]
FUN name:<get-testGlobalValGetter> visibility:public modality:FINAL <> () returnType:kotlin.String
correspondingProperty: PROPERTY name:testGlobalValGetter visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-testGlobalValGetter> (): kotlin.String declared in <root>'
CALL 'public open fun notNullString (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN name:testJUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public open fun use (s: kotlin.String): kotlin.Unit [operator] declared in <root>.J' type=kotlin.Unit origin=null
s: CALL 'public open fun nullString (): kotlin.String? [operator] declared in <root>.J' type=kotlin.String? origin=null
CALL 'public open fun use (s: kotlin.String): kotlin.Unit [operator] declared in <root>.J' type=kotlin.Unit origin=null
s: CALL 'public open fun notNullString (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
FUN name:testLocalVarUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:ns type:kotlin.String? [val]
CALL 'public open fun nullString (): kotlin.String? [operator] declared in <root>.J' type=kotlin.String? origin=null
CALL 'public open fun use (s: kotlin.String): kotlin.Unit [operator] declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val ns: kotlin.String? [val] declared in <root>.testLocalVarUse' type=kotlin.String? origin=null
VAR name:nns type:kotlin.String [val]
CALL 'public open fun notNullString (): kotlin.String [operator] declared in <root>.J' type=kotlin.String origin=null
CALL 'public open fun use (s: kotlin.String): kotlin.Unit [operator] declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val nns: kotlin.String [val] declared in <root>.testLocalVarUse' type=kotlin.String origin=null
@@ -0,0 +1,39 @@
// FILE: enhancedNullability.kt
// WITH_JDK
fun use(s: String) {}
fun testUse() {
use(J.notNullString())
}
fun testLocalVal() {
val local = J.notNullString()
}
fun testReturnValue() = J.notNullString()
val testGlobalVal = J.notNullString()
val testGlobalValGetter get() = J.notNullString()
fun testJUse() {
J.use(J.nullString())
J.use(J.notNullString())
}
fun testLocalVarUse() {
val ns = J.nullString()
J.use(ns)
val nns = J.notNullString()
J.use(nns)
}
// FILE: J.java
import org.jetbrains.annotations.*;
public class J {
public static void use(@NotNull String s) {}
public static String nullString() { return null; }
public static @NotNull String notNullString() { return null; }
}
@@ -6,22 +6,22 @@ FILE fqName:<root> fileName:/enhancedNullability.kt
BLOCK_BODY
CALL 'public final fun use (s: kotlin.String): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
s: TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
CALL 'public open fun s (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
CALL 'public open fun notNullString (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
FUN name:testLocalVal visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:local type:kotlin.String [val]
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
CALL 'public open fun s (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
CALL 'public open fun notNullString (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
FUN name:testReturnValue visibility:public modality:FINAL <> () returnType:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun testReturnValue (): kotlin.String declared in <root>'
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
CALL 'public open fun s (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
CALL 'public open fun notNullString (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
PROPERTY name:testGlobalVal visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:testGlobalVal type:kotlin.String visibility:private [final,static]
EXPRESSION_BODY
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
CALL 'public open fun s (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
CALL 'public open fun notNullString (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-testGlobalVal> visibility:public modality:FINAL <> () returnType:kotlin.String
correspondingProperty: PROPERTY name:testGlobalVal visibility:public modality:FINAL [val]
BLOCK_BODY
@@ -33,4 +33,21 @@ FILE fqName:<root> fileName:/enhancedNullability.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-testGlobalValGetter> (): kotlin.String declared in <root>'
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
CALL 'public open fun s (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
CALL 'public open fun notNullString (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
FUN name:testJUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
CALL 'public open fun use (s: kotlin.String): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
s: CALL 'public open fun nullString (): kotlin.String? declared in <root>.J' type=kotlin.String? origin=null
CALL 'public open fun use (s: kotlin.String): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
s: CALL 'public open fun notNullString (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
FUN name:testLocalVarUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:ns type:kotlin.String? [val]
CALL 'public open fun nullString (): kotlin.String? declared in <root>.J' type=kotlin.String? origin=null
CALL 'public open fun use (s: kotlin.String): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val ns: kotlin.String? [val] declared in <root>.testLocalVarUse' type=kotlin.String? origin=null
VAR name:nns type:kotlin.String [val]
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
CALL 'public open fun notNullString (): kotlin.String declared in <root>.J' type=kotlin.String origin=null
CALL 'public open fun use (s: kotlin.String): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val nns: kotlin.String [val] declared in <root>.testLocalVarUse' type=kotlin.String origin=null
@@ -0,0 +1,186 @@
FILE fqName:<root> fileName:/enhancedNullabilityInDestructuringAssignment.kt
FUN name:use visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:kotlin.Any
VALUE_PARAMETER name:y index:1 type:kotlin.Any
BLOCK_BODY
CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.P
CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:<root>.P [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:y index:1 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-x>' type=<root>.P origin=null
PROPERTY name:y visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'y: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-y> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-y> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-y>' type=<root>.P origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.P'
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.P declared in <root>.P.component1' type=<root>.P origin=null
FUN name:component2 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int [operator] declared in <root>.P'
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.P declared in <root>.P.component2' type=<root>.P origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Q
TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?]
TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (x:T1 of <root>.Q, y:T2 of <root>.Q) returnType:<root>.Q<T1 of <root>.Q, T2 of <root>.Q> [primary]
VALUE_PARAMETER name:x index:0 type:T1 of <root>.Q
VALUE_PARAMETER name:y index:1 type:T2 of <root>.Q
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:T1 of <root>.Q visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: T1 of <root>.Q declared in <root>.Q.<init>' type=T1 of <root>.Q origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Q) returnType:T1 of <root>.Q
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Q
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): T1 of <root>.Q declared in <root>.Q'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T1 of <root>.Q visibility:private [final]' type=T1 of <root>.Q origin=null
receiver: GET_VAR '<this>: <root>.Q declared in <root>.Q.<get-x>' type=<root>.Q origin=null
PROPERTY name:y visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:y type:T2 of <root>.Q visibility:private [final]
EXPRESSION_BODY
GET_VAR 'y: T2 of <root>.Q declared in <root>.Q.<init>' type=T2 of <root>.Q origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-y> visibility:public modality:FINAL <> ($this:<root>.Q) returnType:T2 of <root>.Q
correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Q
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-y> (): T2 of <root>.Q declared in <root>.Q'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:T2 of <root>.Q visibility:private [final]' type=T2 of <root>.Q origin=null
receiver: GET_VAR '<this>: <root>.Q declared in <root>.Q.<get-y>' type=<root>.Q origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Q) returnType:T1 of <root>.Q [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Q
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q'
CALL 'public final fun <get-x> (): T1 of <root>.Q declared in <root>.Q' type=T1 of <root>.Q origin=null
$this: GET_VAR '<this>: <root>.Q declared in <root>.Q.component1' type=<root>.Q origin=null
FUN name:component2 visibility:public modality:FINAL <> ($this:<root>.Q) returnType:T2 of <root>.Q [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Q
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q'
CALL 'public final fun <get-y> (): T2 of <root>.Q declared in <root>.Q' type=T2 of <root>.Q origin=null
$this: GET_VAR '<this>: <root>.Q declared in <root>.Q.component2' type=<root>.Q origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.P [val]
CALL 'public open fun notNullP (): <root>.P [operator] declared in <root>.J' type=<root>.P origin=null
VAR name:x type:kotlin.Int [val]
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_0: <root>.P [val] declared in <root>.test1' type=<root>.P origin=null
VAR name:y type:kotlin.Int [val]
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_0: <root>.P [val] declared in <root>.test1' type=<root>.P origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test1' type=kotlin.Int origin=null
y: GET_VAR 'val y: kotlin.Int [val] declared in <root>.test1' type=kotlin.Int origin=null
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Q<kotlin.String, kotlin.String>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<kotlin.String, kotlin.String>? [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR name:x type:kotlin.String [val]
CALL 'public final fun component1 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_1: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR name:y type:kotlin.String [val]
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_1: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: kotlin.String [val] declared in <root>.test2' type=kotlin.String origin=null
y: GET_VAR 'val y: kotlin.String [val] declared in <root>.test2' type=kotlin.String origin=null
FUN name:test2Desugared visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:tmp type:<root>.Q<kotlin.String, kotlin.String>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<kotlin.String, kotlin.String>? [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR name:x type:kotlin.String [val]
CALL 'public final fun component1 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2Desugared' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
VAR name:y type:kotlin.String [val]
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp: <root>.Q<kotlin.String, kotlin.String>? [val] declared in <root>.test2Desugared' type=<root>.Q<kotlin.String, kotlin.String>? origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: kotlin.String [val] declared in <root>.test2Desugared' type=kotlin.String origin=null
y: GET_VAR 'val y: kotlin.String [val] declared in <root>.test2Desugared' type=kotlin.String origin=null
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Q<kotlin.String, kotlin.String> [val]
CALL 'public open fun notNullQAndComponents (): <root>.Q<kotlin.String, kotlin.String> [operator] declared in <root>.J' type=<root>.Q<kotlin.String, kotlin.String> origin=null
VAR name:x type:kotlin.String [val]
CALL 'public final fun component1 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_2: <root>.Q<kotlin.String, kotlin.String> [val] declared in <root>.test3' type=<root>.Q<kotlin.String, kotlin.String> origin=null
VAR name:y type:kotlin.String [val]
CALL 'public final fun component2 (): kotlin.String [operator] declared in <root>.Q' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_2: <root>.Q<kotlin.String, kotlin.String> [val] declared in <root>.test3' type=<root>.Q<kotlin.String, kotlin.String> origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: kotlin.String [val] declared in <root>.test3' type=kotlin.String origin=null
y: GET_VAR 'val y: kotlin.String [val] declared in <root>.test3' type=kotlin.String origin=null
FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.IndexedValue<<root>.P> [val]
CALL 'public final fun first <T> (): T of kotlin.collections.first declared in kotlin.collections' type=kotlin.collections.IndexedValue<<root>.P> origin=null
<T>: kotlin.collections.IndexedValue<<root>.P>
$receiver: CALL 'public final fun withIndex <T> (): kotlin.collections.Iterable<kotlin.collections.IndexedValue<T of kotlin.collections.withIndex>> declared in kotlin.collections' type=kotlin.collections.Iterable<kotlin.collections.IndexedValue<<root>.P>> origin=null
<T>: <root>.P
$receiver: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR name:x type:kotlin.Int [val]
CALL 'public final fun component1 (): kotlin.Int [operator] declared in kotlin.collections.IndexedValue' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<<root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<<root>.P> origin=null
VAR name:y type:<root>.P [val]
CALL 'public final fun component2 (): <root>.P [operator] declared in kotlin.collections.IndexedValue' type=<root>.P origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<<root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<<root>.P> origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test4' type=kotlin.Int origin=null
y: GET_VAR 'val y: <root>.P [val] declared in <root>.test4' type=<root>.P origin=null
@@ -0,0 +1,59 @@
// FILE: enhancedNullabilityInDestructuringAssignment.kt
// WITH_RUNTIME
fun use(x: Any, y: Any) {}
class P(val x: Int, val y: Int) {
operator fun component1() = x
operator fun component2() = y
}
class Q<T1, T2>(val x: T1, val y: T2) {
operator fun component1() = x
operator fun component2() = y
}
fun test1() {
// See KT-36344
val (x, y) = J.notNullP()
use(x, y)
}
fun test2() {
// See KT-36347
val (x, y) = J.notNullComponents()
use(x, y)
}
fun test2Desugared() {
val tmp = J.notNullComponents()
val x = tmp.component1()
val y = tmp.component2()
use(x, y)
}
fun test3() {
// See KT-36347
val (x, y) = J.notNullQAndComponents()
use(x, y)
}
fun test4() {
// See KT-36347
val (x, y) = J.listOfNotNull().withIndex().first()
use(x, y)
}
// FILE: J.java
import java.util.*;
import org.jetbrains.annotations.*;
public static class J {
public static @NotNull P notNullP() { return null; }
public static Q<@NotNull String, @NotNull String> notNullComponents() { return null; }
public static @NotNull Q<@NotNull String, @NotNull String> notNullQAndComponents() { return null; }
public static List<@NotNull P> listOfNotNull() { return null; }
}
@@ -0,0 +1,206 @@
FILE fqName:<root> fileName:/enhancedNullabilityInDestructuringAssignment.kt
FUN name:use visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:kotlin.Any
VALUE_PARAMETER name:y index:1 type:kotlin.Any
BLOCK_BODY
CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.P
CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:<root>.P [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:y index:1 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-x>' type=<root>.P origin=null
PROPERTY name:y visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'y: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-y> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-y> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-y>' type=<root>.P origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.P'
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.P declared in <root>.P.component1' type=<root>.P origin=null
FUN name:component2 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int [operator] declared in <root>.P'
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.P declared in <root>.P.component2' type=<root>.P origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>
TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?]
TYPE_PARAMETER name:T2 index:1 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (x:T1 of <root>.Q, y:T2 of <root>.Q) returnType:<root>.Q<T1 of <root>.Q, T2 of <root>.Q> [primary]
VALUE_PARAMETER name:x index:0 type:T1 of <root>.Q
VALUE_PARAMETER name:y index:1 type:T2 of <root>.Q
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Q modality:FINAL visibility:public superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:T1 of <root>.Q visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: T1 of <root>.Q declared in <root>.Q.<init>' type=T1 of <root>.Q origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>) returnType:T1 of <root>.Q
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): T1 of <root>.Q declared in <root>.Q'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T1 of <root>.Q visibility:private [final]' type=T1 of <root>.Q origin=null
receiver: GET_VAR '<this>: <root>.Q<T1 of <root>.Q, T2 of <root>.Q> declared in <root>.Q.<get-x>' type=<root>.Q<T1 of <root>.Q, T2 of <root>.Q> origin=null
PROPERTY name:y visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:y type:T2 of <root>.Q visibility:private [final]
EXPRESSION_BODY
GET_VAR 'y: T2 of <root>.Q declared in <root>.Q.<init>' type=T2 of <root>.Q origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-y> visibility:public modality:FINAL <> ($this:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>) returnType:T2 of <root>.Q
correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-y> (): T2 of <root>.Q declared in <root>.Q'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:T2 of <root>.Q visibility:private [final]' type=T2 of <root>.Q origin=null
receiver: GET_VAR '<this>: <root>.Q<T1 of <root>.Q, T2 of <root>.Q> declared in <root>.Q.<get-y>' type=<root>.Q<T1 of <root>.Q, T2 of <root>.Q> origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>) returnType:T1 of <root>.Q [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q'
CALL 'public final fun <get-x> (): T1 of <root>.Q declared in <root>.Q' type=T1 of <root>.Q origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Q<T1 of <root>.Q, T2 of <root>.Q> declared in <root>.Q.component1' type=<root>.Q<T1 of <root>.Q, T2 of <root>.Q> origin=null
FUN name:component2 visibility:public modality:FINAL <> ($this:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>) returnType:T2 of <root>.Q [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Q<T1 of <root>.Q, T2 of <root>.Q>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q'
CALL 'public final fun <get-y> (): T2 of <root>.Q declared in <root>.Q' type=T2 of <root>.Q origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Q<T1 of <root>.Q, T2 of <root>.Q> declared in <root>.Q.component2' type=<root>.Q<T1 of <root>.Q, T2 of <root>.Q> origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:<root>.P [val]
CALL 'public open fun notNullP (): <root>.P declared in <root>.J' type=<root>.P origin=null
VAR name:x type:kotlin.Int [val]
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=COMPONENT_N(index=1)
$this: TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
GET_VAR 'val tmp_0: <root>.P [val] declared in <root>.test1' type=<root>.P origin=null
VAR name:y type:kotlin.Int [val]
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=COMPONENT_N(index=2)
$this: TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
GET_VAR 'val tmp_0: <root>.P [val] declared in <root>.test1' type=<root>.P origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test1' type=kotlin.Int origin=null
y: GET_VAR 'val y: kotlin.Int [val] declared in <root>.test1' type=kotlin.Int origin=null
FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? declared in <root>.J' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? origin=null
VAR name:x type:@[NotNull(value = <null>)] kotlin.String [val]
CALL 'public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q' type=@[NotNull(value = <null>)] kotlin.String origin=COMPONENT_N(index=1)
$this: TYPE_OP type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=IMPLICIT_NOTNULL typeOperand=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>
GET_VAR 'val tmp_1: <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? [val] declared in <root>.test2' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? origin=null
VAR name:y type:@[NotNull(value = <null>)] kotlin.String [val]
CALL 'public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q' type=@[NotNull(value = <null>)] kotlin.String origin=COMPONENT_N(index=2)
$this: TYPE_OP type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=IMPLICIT_NOTNULL typeOperand=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>
GET_VAR 'val tmp_1: <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? [val] declared in <root>.test2' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: TYPE_OP type=@[NotNull(value = <null>)] kotlin.String origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] kotlin.String
GET_VAR 'val x: @[NotNull(value = <null>)] kotlin.String [val] declared in <root>.test2' type=@[NotNull(value = <null>)] kotlin.String origin=null
y: TYPE_OP type=@[NotNull(value = <null>)] kotlin.String origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] kotlin.String
GET_VAR 'val y: @[NotNull(value = <null>)] kotlin.String [val] declared in <root>.test2' type=@[NotNull(value = <null>)] kotlin.String origin=null
FUN name:test2Desugared visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:tmp type:<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? [val]
CALL 'public open fun notNullComponents (): <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? declared in <root>.J' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? origin=null
VAR name:x type:@[NotNull(value = <null>)] kotlin.String [val]
TYPE_OP type=@[NotNull(value = <null>)] kotlin.String origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] kotlin.String
CALL 'public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q' type=@[NotNull(value = <null>)] kotlin.String origin=null
$this: TYPE_OP type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=IMPLICIT_NOTNULL typeOperand=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>
GET_VAR 'val tmp: <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? [val] declared in <root>.test2Desugared' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? origin=null
VAR name:y type:@[NotNull(value = <null>)] kotlin.String [val]
TYPE_OP type=@[NotNull(value = <null>)] kotlin.String origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] kotlin.String
CALL 'public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q' type=@[NotNull(value = <null>)] kotlin.String origin=null
$this: TYPE_OP type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=IMPLICIT_NOTNULL typeOperand=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>
GET_VAR 'val tmp: <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? [val] declared in <root>.test2Desugared' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>? origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: @[NotNull(value = <null>)] kotlin.String [val] declared in <root>.test2Desugared' type=@[NotNull(value = <null>)] kotlin.String origin=null
y: GET_VAR 'val y: @[NotNull(value = <null>)] kotlin.String [val] declared in <root>.test2Desugared' type=@[NotNull(value = <null>)] kotlin.String origin=null
FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> [val]
CALL 'public open fun notNullQAndComponents (): <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> declared in <root>.J' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=null
VAR name:x type:@[NotNull(value = <null>)] kotlin.String [val]
CALL 'public final fun component1 (): T1 of <root>.Q [operator] declared in <root>.Q' type=@[NotNull(value = <null>)] kotlin.String origin=COMPONENT_N(index=1)
$this: TYPE_OP type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=IMPLICIT_NOTNULL typeOperand=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>
GET_VAR 'val tmp_2: <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> [val] declared in <root>.test3' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=null
VAR name:y type:@[NotNull(value = <null>)] kotlin.String [val]
CALL 'public final fun component2 (): T2 of <root>.Q [operator] declared in <root>.Q' type=@[NotNull(value = <null>)] kotlin.String origin=COMPONENT_N(index=2)
$this: TYPE_OP type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=IMPLICIT_NOTNULL typeOperand=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String>
GET_VAR 'val tmp_2: <root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> [val] declared in <root>.test3' type=<root>.Q<@[NotNull(value = <null>)] kotlin.String, @[NotNull(value = <null>)] kotlin.String> origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: TYPE_OP type=@[NotNull(value = <null>)] kotlin.String origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] kotlin.String
GET_VAR 'val x: @[NotNull(value = <null>)] kotlin.String [val] declared in <root>.test3' type=@[NotNull(value = <null>)] kotlin.String origin=null
y: TYPE_OP type=@[NotNull(value = <null>)] kotlin.String origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] kotlin.String
GET_VAR 'val y: @[NotNull(value = <null>)] kotlin.String [val] declared in <root>.test3' type=@[NotNull(value = <null>)] kotlin.String origin=null
FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P> [val]
CALL 'public final fun first <T> (): T of kotlin.collections.first declared in kotlin.collections' type=kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P> origin=null
<T>: kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P>
$receiver: CALL 'public final fun withIndex <T> (): kotlin.collections.Iterable<kotlin.collections.IndexedValue<T of kotlin.collections.withIndex>> declared in kotlin.collections' type=kotlin.collections.Iterable<kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P>> origin=null
<T>: @[NotNull(value = <null>)] <root>.P
$receiver: TYPE_OP type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>
CALL 'public open fun listOfNotNull (): kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? declared in <root>.J' type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? origin=null
VAR name:x type:kotlin.Int [val]
CALL 'public final fun component1 (): kotlin.Int [operator] declared in kotlin.collections.IndexedValue' type=kotlin.Int origin=COMPONENT_N(index=1)
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P> origin=null
VAR name:y type:@[NotNull(value = <null>)] <root>.P [val]
CALL 'public final fun component2 (): T of kotlin.collections.IndexedValue [operator] declared in kotlin.collections.IndexedValue' type=@[NotNull(value = <null>)] <root>.P origin=COMPONENT_N(index=2)
$this: GET_VAR 'val tmp_3: kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.test4' type=kotlin.collections.IndexedValue<@[NotNull(value = <null>)] <root>.P> origin=null
CALL 'public final fun use (x: kotlin.Any, y: kotlin.Any): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
x: GET_VAR 'val x: kotlin.Int [val] declared in <root>.test4' type=kotlin.Int origin=null
y: TYPE_OP type=@[NotNull(value = <null>)] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] <root>.P
GET_VAR 'val y: @[NotNull(value = <null>)] <root>.P [val] declared in <root>.test4' type=@[NotNull(value = <null>)] <root>.P origin=null
@@ -0,0 +1,187 @@
FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
FUN name:use visibility:public modality:FINAL <> (s:<root>.P) returnType:kotlin.Unit
VALUE_PARAMETER name:s index:0 type:<root>.P
BLOCK_BODY
FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.collections.List<<root>.P>? [val]
CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.collections.MutableIterator<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: GET_VAR 'val tmp_0: kotlin.collections.List<<root>.P>? [val] declared in <root>.testForInListUnused' type=kotlin.collections.List<<root>.P>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<<root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:x type:<root>.P [val]
CALL 'public abstract fun next (): <root>.P [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=null
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<<root>.P> origin=null
FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.List<<root>.P>? [val]
CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.MutableIterator<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: GET_VAR 'val tmp_2: kotlin.collections.List<<root>.P>? [val] declared in <root>.testForInListDestructured' type=kotlin.collections.List<<root>.P>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<<root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:<root>.P [val]
CALL 'public abstract fun next (): <root>.P [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=null
$this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<<root>.P> origin=null
VAR name:x type:kotlin.Int [val]
CALL 'public final fun component1 (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_4: <root>.P [val] declared in <root>.testForInListDestructured' type=<root>.P origin=null
VAR name:y type:kotlin.Int [val]
CALL 'public final fun component2 (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_4: <root>.P [val] declared in <root>.testForInListDestructured' type=<root>.P origin=null
FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:iterator type:kotlin.collections.MutableIterator<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
WHILE label=null origin=WHILE_LOOP
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<<root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:x type:<root>.P [val]
CALL 'public abstract fun next (): <root>.P [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<<root>.P> origin=null
FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:<root>.J) returnType:kotlin.Unit
VALUE_PARAMETER name:j index:0 type:<root>.J
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Array<out <root>.P?>? [val]
CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P?>? [operator] declared in <root>.J' type=kotlin.Array<out <root>.P?>? origin=null
$this: GET_VAR 'j: <root>.J declared in <root>.testForInArrayUnused' type=<root>.J origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.collections.Iterator<<root>.P?> [val]
CALL 'public final fun iterator (): kotlin.collections.Iterator<<root>.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<<root>.P?> origin=null
$this: GET_VAR 'val tmp_5: kotlin.Array<out <root>.P?>? [val] declared in <root>.testForInArrayUnused' type=kotlin.Array<out <root>.P?>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val tmp_6: kotlin.collections.Iterator<<root>.P?> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<<root>.P?> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:x type:<root>.P? [val]
CALL 'public abstract fun next (): <root>.P? [operator] declared in kotlin.collections.Iterator' type=<root>.P? origin=null
$this: GET_VAR 'val tmp_6: kotlin.collections.Iterator<<root>.P?> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<<root>.P?> origin=null
FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.collections.List<<root>.P>? [val]
CALL 'public open fun listOfNotNull (): kotlin.collections.List<<root>.P>? [operator] declared in <root>.J' type=kotlin.collections.List<<root>.P>? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.collections.MutableIterator<<root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<<root>.P> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<<root>.P> origin=null
$this: GET_VAR 'val tmp_7: kotlin.collections.List<<root>.P>? [val] declared in <root>.testForInListUse' type=kotlin.collections.List<<root>.P>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val tmp_8: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<<root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:x type:<root>.P [val]
CALL 'public abstract fun next (): <root>.P [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=null
$this: GET_VAR 'val tmp_8: kotlin.collections.MutableIterator<<root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<<root>.P> origin=null
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
s: GET_VAR 'val x: <root>.P [val] declared in <root>.testForInListUse' type=<root>.P origin=null
CALL 'public open fun use (s: <root>.P): kotlin.Unit [operator] declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val x: <root>.P [val] declared in <root>.testForInListUse' type=<root>.P origin=null
FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:<root>.J) returnType:kotlin.Unit
VALUE_PARAMETER name:j index:0 type:<root>.J
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Array<out <root>.P?>? [val]
CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P?>? [operator] declared in <root>.J' type=kotlin.Array<out <root>.P?>? origin=null
$this: GET_VAR 'j: <root>.J declared in <root>.testForInArrayUse' type=<root>.J origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlin.collections.Iterator<<root>.P?> [val]
CALL 'public final fun iterator (): kotlin.collections.Iterator<<root>.P?> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<<root>.P?> origin=null
$this: GET_VAR 'val tmp_9: kotlin.Array<out <root>.P?>? [val] declared in <root>.testForInArrayUse' type=kotlin.Array<out <root>.P?>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val tmp_10: kotlin.collections.Iterator<<root>.P?> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<<root>.P?> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:x type:<root>.P? [val]
CALL 'public abstract fun next (): <root>.P? [operator] declared in kotlin.collections.Iterator' type=<root>.P? origin=null
$this: GET_VAR 'val tmp_10: kotlin.collections.Iterator<<root>.P?> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<<root>.P?> origin=null
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
s: GET_VAR 'val x: <root>.P? [val] declared in <root>.testForInArrayUse' type=<root>.P? origin=null
CALL 'public open fun use (s: <root>.P): kotlin.Unit [operator] declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val x: <root>.P? [val] declared in <root>.testForInArrayUse' type=<root>.P? origin=null
CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K
FUN name:arrayOfNotNull visibility:public modality:ABSTRACT <> ($this:<root>.K) returnType:kotlin.Array<<root>.P>
$this: VALUE_PARAMETER name:<this> type:<root>.K
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.P
CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:<root>.P [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:y index:1 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-x>' type=<root>.P origin=null
PROPERTY name:y visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'y: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-y> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-y> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-y>' type=<root>.P origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int declared in <root>.P'
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.P declared in <root>.P.component1' type=<root>.P origin=null
FUN name:component2 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in <root>.P'
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.P declared in <root>.P.component2' type=<root>.P origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.P, x:kotlin.Int, y:kotlin.Int) returnType:<root>.P
$this: VALUE_PARAMETER name:<this> type:<root>.P
VALUE_PARAMETER name:x index:0 type:kotlin.Int
EXPRESSION_BODY
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.P declared in <root>.P.copy' type=<root>.P origin=null
VALUE_PARAMETER name:y index:1 type:kotlin.Int
EXPRESSION_BODY
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.P declared in <root>.P.copy' type=<root>.P origin=null
BLOCK_BODY
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -0,0 +1,63 @@
// FILE: enhancedNullabilityInForLoop.kt
// WITH_JDK
fun use(s: P) {}
fun testForInListUnused() {
// See KT-36343
for (x in J.listOfNotNull()) {}
}
fun testForInListDestructured() {
// See KT-36343 and KT-36344
for ((x, y) in J.listOfNotNull()) {}
}
fun testDesugaredForInList() {
val iterator = J.listOfNotNull().iterator()
while (iterator.hasNext()) {
val x = iterator.next()
}
}
fun testForInArrayUnused(j: J) {
// See KT-36343
for (x in j.arrayOfNotNull()) {}
}
fun testForInListUse() {
// See KT-36343
for (x in J.listOfNotNull()) {
use(x)
J.use(x)
}
}
fun testForInArrayUse(j: J) {
// See KT-36343
for (x in j.arrayOfNotNull()) {
use(x)
J.use(x)
}
}
interface K {
fun arrayOfNotNull(): Array<P>
}
data class P(val x: Int, val y: Int)
// FILE: J.java
import java.util.*;
import org.jetbrains.annotations.*;
public class J implements K {
public static void use(@NotNull P s) {}
public static @NotNull P notNull() { return null; }
public static List<@NotNull P> listOfNotNull() { return null; }
@Override
public P[] arrayOfNotNull() { return null; }
}
@@ -0,0 +1,270 @@
FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
FUN name:use visibility:public modality:FINAL <> (s:<root>.P) returnType:kotlin.Unit
VALUE_PARAMETER name:s index:0 type:<root>.P
BLOCK_BODY
FUN name:testForInListUnused visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<E of kotlin.collections.MutableList> [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=FOR_LOOP_ITERATOR
$this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*>
TYPE_OP type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>
CALL 'public open fun listOfNotNull (): kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? declared in <root>.J' type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = <null>)] <root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[NotNull(value = <null>)] <root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testForInListUnused' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
BLOCK type=kotlin.Unit origin=null
FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<E of kotlin.collections.MutableList> [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=FOR_LOOP_ITERATOR
$this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*>
TYPE_OP type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>
CALL 'public open fun listOfNotNull (): kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? declared in <root>.J' type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:@[NotNull(value = <null>)] <root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[NotNull(value = <null>)] <root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testForInListDestructured' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
VAR name:x type:kotlin.Int [val]
CALL 'public final fun component1 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=COMPONENT_N(index=1)
$this: TYPE_OP type=@[NotNull(value = <null>)] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] <root>.P
GET_VAR 'val tmp_2: @[NotNull(value = <null>)] <root>.P [val] declared in <root>.testForInListDestructured' type=@[NotNull(value = <null>)] <root>.P origin=null
VAR name:y type:kotlin.Int [val]
CALL 'public final fun component2 (): kotlin.Int [operator] declared in <root>.P' type=kotlin.Int origin=COMPONENT_N(index=2)
$this: TYPE_OP type=@[NotNull(value = <null>)] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] <root>.P
GET_VAR 'val tmp_2: @[NotNull(value = <null>)] <root>.P [val] declared in <root>.testForInListDestructured' type=@[NotNull(value = <null>)] <root>.P origin=null
BLOCK type=kotlin.Unit origin=null
FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:iterator type:kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<E of kotlin.collections.MutableList> [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
$this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*>
TYPE_OP type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>
CALL 'public open fun listOfNotNull (): kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? declared in <root>.J' type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? origin=null
WHILE label=null origin=WHILE_LOOP
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:x type:@[NotNull(value = <null>)] <root>.P [val]
TYPE_OP type=@[NotNull(value = <null>)] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] <root>.P
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[NotNull(value = <null>)] <root>.P origin=null
$this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testDesugaredForInList' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:<root>.J) returnType:kotlin.Unit
VALUE_PARAMETER name:j index:0 type:<root>.J
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.Iterator<<root>.P> [val]
CALL 'public final fun iterator (): kotlin.collections.Iterator<T of kotlin.Array> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<<root>.P> origin=FOR_LOOP_ITERATOR
$this: TYPE_OP type=kotlin.Array<<root>.P> origin=IMPLICIT_CAST typeOperand=kotlin.Array<<root>.P>
TYPE_OP type=kotlin.Array<out <root>.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.Array<out <root>.P>
CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P> declared in <root>.J' type=kotlin.Array<out <root>.P> origin=null
$this: GET_VAR 'j: <root>.J declared in <root>.testForInArrayUnused' type=<root>.J origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<<root>.P> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<<root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:x type:<root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_3: kotlin.collections.Iterator<<root>.P> [val] declared in <root>.testForInArrayUnused' type=kotlin.collections.Iterator<<root>.P> origin=null
BLOCK type=kotlin.Unit origin=null
FUN name:testForInListUse visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_4 type:kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val]
CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<E of kotlin.collections.MutableList> [fake_override,operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=FOR_LOOP_ITERATOR
$this: TYPE_OP type=kotlin.collections.MutableList<*> origin=IMPLICIT_CAST typeOperand=kotlin.collections.MutableList<*>
TYPE_OP type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>
CALL 'public open fun listOfNotNull (): kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? declared in <root>.J' type=kotlin.collections.List<@[NotNull(value = <null>)] <root>.P>? origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [fake_override,operator] declared in kotlin.collections.MutableIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:x type:@[NotNull(value = <null>)] <root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [fake_override,operator] declared in kotlin.collections.MutableIterator' type=@[NotNull(value = <null>)] <root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_4: kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> [val] declared in <root>.testForInListUse' type=kotlin.collections.MutableIterator<@[NotNull(value = <null>)] <root>.P> origin=null
BLOCK type=kotlin.Unit origin=null
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
s: TYPE_OP type=@[NotNull(value = <null>)] <root>.P origin=IMPLICIT_NOTNULL typeOperand=@[NotNull(value = <null>)] <root>.P
GET_VAR 'val x: @[NotNull(value = <null>)] <root>.P [val] declared in <root>.testForInListUse' type=@[NotNull(value = <null>)] <root>.P origin=null
CALL 'public open fun use (s: <root>.P): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val x: @[NotNull(value = <null>)] <root>.P [val] declared in <root>.testForInListUse' type=@[NotNull(value = <null>)] <root>.P origin=null
FUN name:testForInArrayUse visibility:public modality:FINAL <> (j:<root>.J) returnType:kotlin.Unit
VALUE_PARAMETER name:j index:0 type:<root>.J
BLOCK_BODY
BLOCK type=kotlin.Unit origin=FOR_LOOP
VAR FOR_LOOP_ITERATOR name:tmp_5 type:kotlin.collections.Iterator<<root>.P> [val]
CALL 'public final fun iterator (): kotlin.collections.Iterator<T of kotlin.Array> [operator] declared in kotlin.Array' type=kotlin.collections.Iterator<<root>.P> origin=FOR_LOOP_ITERATOR
$this: TYPE_OP type=kotlin.Array<<root>.P> origin=IMPLICIT_CAST typeOperand=kotlin.Array<<root>.P>
TYPE_OP type=kotlin.Array<out <root>.P> origin=IMPLICIT_NOTNULL typeOperand=kotlin.Array<out <root>.P>
CALL 'public open fun arrayOfNotNull (): kotlin.Array<out <root>.P> declared in <root>.J' type=kotlin.Array<out <root>.P> origin=null
$this: GET_VAR 'j: <root>.J declared in <root>.testForInArrayUse' type=<root>.J origin=null
WHILE label=null origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<<root>.P> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<<root>.P> origin=null
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
VAR FOR_LOOP_VARIABLE name:x type:<root>.P [val]
CALL 'public abstract fun next (): T of kotlin.collections.Iterator [operator] declared in kotlin.collections.Iterator' type=<root>.P origin=FOR_LOOP_NEXT
$this: GET_VAR 'val tmp_5: kotlin.collections.Iterator<<root>.P> [val] declared in <root>.testForInArrayUse' type=kotlin.collections.Iterator<<root>.P> origin=null
BLOCK type=kotlin.Unit origin=null
CALL 'public final fun use (s: <root>.P): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
s: TYPE_OP type=<root>.P origin=IMPLICIT_NOTNULL typeOperand=<root>.P
GET_VAR 'val x: <root>.P [val] declared in <root>.testForInArrayUse' type=<root>.P origin=null
CALL 'public open fun use (s: <root>.P): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
s: GET_VAR 'val x: <root>.P [val] declared in <root>.testForInArrayUse' type=<root>.P origin=null
CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.K
FUN name:arrayOfNotNull visibility:public modality:ABSTRACT <> ($this:<root>.K) returnType:kotlin.Array<<root>.P>
$this: VALUE_PARAMETER name:<this> type:<root>.K
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.P
CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int) returnType:<root>.P [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:y index:1 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public [data] superTypes:[kotlin.Any]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-x>' type=<root>.P origin=null
PROPERTY name:y visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
GET_VAR 'y: kotlin.Int declared in <root>.P.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-y> visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int
correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-y> (): kotlin.Int declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.<get-y>' type=<root>.P origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.component1' type=<root>.P origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:<root>.P) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int [operator] declared in <root>.P'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.component2' type=<root>.P origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.P, x:kotlin.Int, y:kotlin.Int) returnType:<root>.P
$this: VALUE_PARAMETER name:<this> type:<root>.P
VALUE_PARAMETER name:x index:0 type:kotlin.Int
EXPRESSION_BODY
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.copy' type=<root>.P origin=null
VALUE_PARAMETER name:y index:1 type:kotlin.Int
EXPRESSION_BODY
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.copy' type=<root>.P origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.Int): <root>.P declared in <root>.P'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.P' type=<root>.P origin=null
x: GET_VAR 'x: kotlin.Int declared in <root>.P.copy' type=kotlin.Int origin=null
y: GET_VAR 'y: kotlin.Int declared in <root>.P.copy' type=kotlin.Int origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.P) returnType:kotlin.String
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.P'
STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="P("
CONST String type=kotlin.String value="x="
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.toString' type=<root>.P origin=null
CONST String type=kotlin.String value=", "
CONST String type=kotlin.String value="y="
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.toString' type=<root>.P origin=null
CONST String type=kotlin.String value=")"
FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.P) returnType:kotlin.Int
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.P
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.P'
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.hashCode' type=<root>.P origin=null
other: CONST Int type=kotlin.Int value=31
other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.hashCode' type=<root>.P origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.P, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:<root>.P
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
BLOCK_BODY
WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
arg0: GET_VAR '<this>: <root>.P declared in <root>.P.equals' type=<root>.P origin=null
arg1: GET_VAR 'other: kotlin.Any? declared in <root>.P.equals' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.P'
CONST Boolean type=kotlin.Boolean value=true
WHEN type=kotlin.Unit origin=null
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.P
GET_VAR 'other: kotlin.Any? declared in <root>.P.equals' type=kotlin.Any? origin=null
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.P'
CONST Boolean type=kotlin.Boolean value=false
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:<root>.P [val]
TYPE_OP type=<root>.P origin=CAST typeOperand=<root>.P
GET_VAR 'other: kotlin.Any? declared in <root>.P.equals' type=kotlin.Any? origin=null
WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.equals' type=<root>.P origin=null
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR 'val tmp_6: <root>.P [val] declared in <root>.P.equals' type=<root>.P origin=null
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.P'
CONST Boolean type=kotlin.Boolean value=false
WHEN type=kotlin.Unit origin=null
BRANCH
if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.P declared in <root>.P.equals' type=<root>.P origin=null
arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR 'val tmp_6: <root>.P [val] declared in <root>.P.equals' type=<root>.P origin=null
then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.P'
CONST Boolean type=kotlin.Boolean value=false
RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.P'
CONST Boolean type=kotlin.Boolean value=true
@@ -1806,26 +1806,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/types/asOnPlatformType.kt");
}
@TestMetadata("enhancedNullability.kt")
public void testEnhancedNullability() throws Exception {
runTest("compiler/testData/ir/irText/types/enhancedNullability.kt");
}
@TestMetadata("explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt")
public void testExplicitEqualsAndCompareToCallsOnPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt");
}
@TestMetadata("genericPropertyReferenceType.kt")
public void testGenericPropertyReferenceType() throws Exception {
runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt");
}
@TestMetadata("implicitNotNullOnPlatformType.kt")
public void testImplicitNotNullOnPlatformType() throws Exception {
runTest("compiler/testData/ir/irText/types/implicitNotNullOnPlatformType.kt");
}
@TestMetadata("intersectionType1_NI.kt")
public void testIntersectionType1_NI() throws Exception {
runTest("compiler/testData/ir/irText/types/intersectionType1_NI.kt");
@@ -1861,16 +1846,6 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
runTest("compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.kt");
}
@TestMetadata("nullabilityAssertionOnExtensionReceiver.kt")
public void testNullabilityAssertionOnExtensionReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullabilityAssertionOnExtensionReceiver.kt");
}
@TestMetadata("platformTypeReceiver.kt")
public void testPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/platformTypeReceiver.kt");
}
@TestMetadata("smartCastOnFakeOverrideReceiver.kt")
public void testSmartCastOnFakeOverrideReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/smartCastOnFakeOverrideReceiver.kt");
@@ -1885,5 +1860,53 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
public void testSmartCastOnReceiverOfGenericType() throws Exception {
runTest("compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt");
}
@TestMetadata("compiler/testData/ir/irText/types/nullChecks")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NullChecks extends AbstractIrTextTestCase {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInNullChecks() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/irText/types/nullChecks"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("enhancedNullability.kt")
public void testEnhancedNullability() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullability.kt");
}
@TestMetadata("enhancedNullabilityInDestructuringAssignment.kt")
public void testEnhancedNullabilityInDestructuringAssignment() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt");
}
@TestMetadata("enhancedNullabilityInForLoop.kt")
public void testEnhancedNullabilityInForLoop() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt");
}
@TestMetadata("explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt")
public void testExplicitEqualsAndCompareToCallsOnPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.kt");
}
@TestMetadata("implicitNotNullOnPlatformType.kt")
public void testImplicitNotNullOnPlatformType() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/implicitNotNullOnPlatformType.kt");
}
@TestMetadata("nullabilityAssertionOnExtensionReceiver.kt")
public void testNullabilityAssertionOnExtensionReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/nullabilityAssertionOnExtensionReceiver.kt");
}
@TestMetadata("platformTypeReceiver.kt")
public void testPlatformTypeReceiver() throws Exception {
runTest("compiler/testData/ir/irText/types/nullChecks/platformTypeReceiver.kt");
}
}
}
}