diff --git a/compiler/fir/analysis-tests/testData/extendedCheckers/RedundantSingleExpressionStringTemplateChecker.txt b/compiler/fir/analysis-tests/testData/extendedCheckers/RedundantSingleExpressionStringTemplateChecker.txt index 17162b3a946..33f8dbee0aa 100644 --- a/compiler/fir/analysis-tests/testData/extendedCheckers/RedundantSingleExpressionStringTemplateChecker.txt +++ b/compiler/fir/analysis-tests/testData/extendedCheckers/RedundantSingleExpressionStringTemplateChecker.txt @@ -20,11 +20,11 @@ FILE: RedundantSingleExpressionStringTemplateChecker.kt public get(): R|ProductGroup?| public final val name: R|kotlin/String| = when () { - ==(R|/parent|, Null(null)) -> { - R|/short_name| + ==(this@R|/ProductGroup|.R|/ProductGroup.parent|, Null(null)) -> { + this@R|/ProductGroup|.R|/ProductGroup.short_name| } else -> { - (R|/parent|.R|/ProductGroup.name|.R|kotlin/Any.toString|(), String( ), R|/short_name|.R|kotlin/Any.toString|()) + (this@R|/ProductGroup|.R|/ProductGroup.parent|.R|/ProductGroup.name|.R|kotlin/Any.toString|(), String( ), this@R|/ProductGroup|.R|/ProductGroup.short_name|.R|kotlin/Any.toString|()) } } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.txt index 10667bdb45b..0c98a86e75f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.txt @@ -47,7 +47,7 @@ FILE: propertyTypeMismatchOnOverride.kt public final val value: R|T| = R|/value| public get(): R|T| - public final override var test: R|T| = R|/value| + public final override var test: R|T| = this@R|/E|.R|/E.value| public get(): R|T| public set(value: R|T|): R|kotlin/Unit| @@ -60,7 +60,7 @@ FILE: propertyTypeMismatchOnOverride.kt public final val value: R|T| = R|/value| public get(): R|T| - public open var rest: R|T| = R|/value| + public open var rest: R|T| = this@R|/F|.R|/F.value| public get(): R|T| public set(value: R|T|): R|kotlin/Unit| @@ -73,7 +73,7 @@ FILE: propertyTypeMismatchOnOverride.kt public final val balue: R|E| = R|/balue| public get(): R|E| - public final override var rest: R|E| = R|/balue| + public final override var rest: R|E| = this@R|/G|.R|/G.balue| public get(): R|E| public set(value: R|E|): R|kotlin/Unit| @@ -86,7 +86,7 @@ FILE: propertyTypeMismatchOnOverride.kt public final val balue: R|E| = R|/balue| public get(): R|E| - public final override var rest: R|E| = R|/balue| + public final override var rest: R|E| = this@R|/H|.R|/H.balue| public get(): R|E| public set(value: R|E|): R|kotlin/Unit| @@ -99,7 +99,7 @@ FILE: propertyTypeMismatchOnOverride.kt public final val balue: R|E| = R|/balue| public get(): R|E| - public final override var rest: R|E| = R|/balue| + public final override var rest: R|E| = this@R|/M|.R|/M.balue| public get(): R|E| public set(value: R|E|): R|kotlin/Unit| diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/repeatedModifier.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/repeatedModifier.txt index 8e246a8b308..c339f7936ce 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/repeatedModifier.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/repeatedModifier.txt @@ -47,7 +47,7 @@ FILE: repeatedModifier.kt private final val int: R|kotlin/Int| = R|/int| private get(): R|kotlin/Int| - protected final var double: R|kotlin/Double| = R|/int|.R|kotlin/Int.plus|(Double(8.0)) + protected final var double: R|kotlin/Double| = this@R|/E|.R|/E.int|.R|kotlin/Int.plus|(Double(8.0)) protected get(): R|kotlin/Double| protected set(value: R|kotlin/Double|): R|kotlin/Unit| diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt index 88de595fbbc..25fc8971ece 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt @@ -29,7 +29,7 @@ FILE: CallBasedInExpressionGenerator.kt public final val codegen: R|org/jetbrains/kotlin/codegen/range/inExpression/ExpressionCodegen| = R|/codegen| public get(): R|org/jetbrains/kotlin/codegen/range/inExpression/ExpressionCodegen| - private final val resolvedCall: R|ERROR CLASS: Unresolved name: getResolvedCallWithAssert| = R|/operatorReference|.#(R|/codegen|.#) + private final val resolvedCall: R|ERROR CLASS: Unresolved name: getResolvedCallWithAssert| = R|/operatorReference|.#(this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.codegen|.#) private get(): R|ERROR CLASS: Unresolved name: getResolvedCallWithAssert| private final val isInverted: R|kotlin/Boolean| = ==(R|/operatorReference|.#(), #.#) diff --git a/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt b/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt index b403c258302..a852210282e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt +++ b/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt @@ -58,7 +58,7 @@ FILE: enums.kt } - public final val g: R|kotlin/Double| = this@R|/Planet.Companion|.R|/Planet.Companion.G|.R|kotlin/Double.times|(R|/m|).R|kotlin/Double.div|(R|/r|.R|kotlin/Double.times|(R|/r|)) + public final val g: R|kotlin/Double| = this@R|/Planet.Companion|.R|/Planet.Companion.G|.R|kotlin/Double.times|(this@R|/Planet|.R|/Planet.m|).R|kotlin/Double.div|(this@R|/Planet|.R|/Planet.r|.R|kotlin/Double.times|(this@R|/Planet|.R|/Planet.r|)) public get(): R|kotlin/Double| public abstract fun sayHello(): R|kotlin/Unit| diff --git a/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt b/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt index 5b1c6449801..75cea3d673b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt +++ b/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt @@ -46,9 +46,9 @@ FILE: KotlinClass.kt public get(): R|JavaClass?| public final val x: R|(KotlinClass) -> kotlin/Boolean| = when () { - !=(R|/javaClass|, Null(null)) -> { + !=(this@R|/Case1|.R|/Case1.javaClass|, Null(null)) -> { fun (it: R|KotlinClass|): R|kotlin/Boolean| { - ^ ==(R|/it|, R|/javaClass|) + ^ ==(R|/it|, this@R|/Case1|.R|/Case1.javaClass|) } } @@ -139,9 +139,9 @@ FILE: KotlinClass.kt public get(): R|KotlinClass?| public final val x: R|(KotlinClass) -> kotlin/Boolean| = when () { - !=(R|/kotlinClass|, Null(null)) -> { + !=(this@R|/Case2|.R|/Case2.kotlinClass|, Null(null)) -> { fun (it: R|KotlinClass|): R|kotlin/Boolean| { - ^ ==(R|/it|, R|/kotlinClass|) + ^ ==(R|/it|, this@R|/Case2|.R|/Case2.kotlinClass|) } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt index fa5999da2ab..f8be70de077 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.txt @@ -7,7 +7,7 @@ FILE: simpleDelegatedToMap.kt public final val map: R|kotlin/collections/MutableMap| = R|/map| public get(): R|kotlin/collections/MutableMap| - public final var foo: R|kotlin/Any|by R|/map| + public final var foo: R|kotlin/Any|by this@R|/C|.R|/C.map| public get(): R|kotlin/Any| { ^ this@R|/C|.D|/C.foo|.R|kotlin/collections/getValue|(this@R|/C|, ::R|/C.foo|) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.kt new file mode 100644 index 00000000000..3d4e5944d22 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.kt @@ -0,0 +1,16 @@ +class Some(var foo: Int) { + init { + if (foo < 0) { + foo = 0 + } + } + + val y = run { + foo = 1 + foo + } + + constructor(): this(-1) { + foo = 2 + } +} diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.txt new file mode 100644 index 00000000000..05d357b1494 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.txt @@ -0,0 +1,32 @@ +FILE: constructorVarWrite.kt + public final class Some : R|kotlin/Any| { + public constructor(foo: R|kotlin/Int|): R|Some| { + super() + } + + public final var foo: R|kotlin/Int| = R|/foo| + public get(): R|kotlin/Int| + public set(value: R|kotlin/Int|): R|kotlin/Unit| + + init { + when () { + CMP(<, this@R|/Some|.R|/Some.foo|.R|kotlin/Int.compareTo|(Int(0))) -> { + this@R|/Some|.R|/Some.foo| = Int(0) + } + } + + } + + public final val y: R|kotlin/Int| = this@R|/Some|.R|kotlin/run|( = run@fun R|Some|.(): R|kotlin/Int| { + this@R|special/anonymous|.R|/Some.foo| = Int(1) + ^ this@R|special/anonymous|.R|/Some.foo| + } + ) + public get(): R|kotlin/Int| + + public constructor(): R|Some| { + this(Int(-1)) + this@R|/Some|.R|/Some.foo| = Int(2) + } + + } diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java index 4c9b3b770bd..1f786f88b9a 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java @@ -1235,6 +1235,24 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic } } + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Reinitializations extends AbstractFirDiagnosticsWithStdlibTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInReinitializations() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("constructorVarWrite.kt") + public void testConstructorVarWrite() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.kt"); + } + } + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java index 7003da0303b..626b43d6db6 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java @@ -1811,6 +1811,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { public void testV8ArrayToList() throws Exception { runTest("compiler/testData/ir/irText/firProblems/V8ArrayToList.kt"); } + + @TestMetadata("VarInInit.kt") + public void testVarInInit() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/VarInInit.kt"); + } } @TestMetadata("compiler/testData/ir/irText/lambdas") diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ValueParameter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ValueParameter.kt index 1671b25d44f..b0e4b430539 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ValueParameter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/fir/ValueParameter.kt @@ -5,9 +5,7 @@ package org.jetbrains.kotlin.fir.lightTree.fir -import org.jetbrains.kotlin.fir.FirFakeSourceElementKind -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.copyWithNewSourceKind +import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.declarations.FirProperty import org.jetbrains.kotlin.fir.declarations.FirValueParameter @@ -45,7 +43,12 @@ class ValueParameter( } return buildProperty { - source = firValueParameter.source + val parameterSource = firValueParameter.source as? FirLightSourceElement + val parameterNode = parameterSource?.lightNode + source = parameterNode?.toFirLightSourceElement( + parameterSource.startOffset, parameterSource.endOffset, parameterSource.tree, + FirFakeSourceElementKind.PropertyFromParameter + ) this.session = session origin = FirDeclarationOrigin.Source returnTypeRef = type.copyWithNewSourceKind(FirFakeSourceElementKind.PropertyFromParameter) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/BodyResolveComponents.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/BodyResolveComponents.kt index 266d0c8b5bf..18dae549775 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/BodyResolveComponents.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/BodyResolveComponents.kt @@ -143,7 +143,8 @@ typealias TowerDataContextForAnonymousFunctions = Map acc.storeVariable(param) } } + private fun FirConstructor.scopesWithPrimaryConstructorParameters( + ownerClass: FirClass<*> + ): Pair { + var parameterScope = FirLocalScope() + var allScope = FirLocalScope() + val properties = ownerClass.declarations.filterIsInstance().associateBy { it.name } + for (parameter in valueParameters) { + allScope = allScope.storeVariable(parameter) + val property = properties[parameter.name] + if (property?.source?.kind != FirFakeSourceElementKind.PropertyFromParameter) { + parameterScope = parameterScope.storeVariable(parameter) + } + } + return parameterScope to allScope + } + protected inline fun withLabelAndReceiverType( labelName: Name?, owner: FirCallableDeclaration<*>, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt index fbaaf7358b1..82218152e9e 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt @@ -760,7 +760,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform context.withTowerDataCleanup { if ((context.containerIfAny as? FirConstructor)?.isPrimary == true) { context.replaceTowerDataContext(context.getTowerDataContextForConstructorResolution()) - context.getPrimaryConstructorParametersScope()?.let(context::addLocalScope) + context.getPrimaryConstructorAllParametersScope()?.let(context::addLocalScope) } // it's just a constructor parameters scope created in diff --git a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt index 8b0160f3ba6..5011c17372d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt @@ -2,7 +2,7 @@ sealed class My(open val x: Int?) { init { if (x != null) { // Should be error: property is open - x.hashCode() + x.hashCode() } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt index b229ad774f3..98563e4ea6c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt @@ -3,15 +3,15 @@ class Foo(var x: Int?) { if (x != null) { val y = x // Error: x is not stable, Type(y) = Int? - x.hashCode() - y.hashCode() + x.hashCode() + y.hashCode() if (y == x) { // Still error - y.hashCode() + y.hashCode() } if (x == null && y != x) { // Still error - y.hashCode() + y.hashCode() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/unstableToStableTypes.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/unstableToStableTypes.fir.kt index 75893bf35b7..4702c095847 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/unstableToStableTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/unstableToStableTypes.fir.kt @@ -7,15 +7,15 @@ class Foo(var x: Any) { if (x is Bar) { val y = x // Error: x is not stable, Type(y) = Any - x.bar() - y.bar() + x.bar() + y.bar() if (y == x) { // Still error - y.bar() + y.bar() } if (x !is Bar && y != x) { // Still error - y.bar() + y.bar() } } } diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt index f9d7f95429c..47dad12b6e2 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt @@ -60,7 +60,8 @@ FILE fqName: fileName:/delegatedProperties.kt PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] EXPRESSION_BODY - GET_VAR 'map: kotlin.collections.MutableMap declared in .C.' type=kotlin.collections.MutableMap origin=null + CALL 'public final fun (): kotlin.collections.MutableMap declared in .C' type=kotlin.collections.MutableMap origin=GET_PROPERTY + $this: GET_VAR ': .C declared in .C' type=.C origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Any correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] $this: VALUE_PARAMETER name: type:.C diff --git a/compiler/testData/ir/irText/firProblems/VarInInit.kt b/compiler/testData/ir/irText/firProblems/VarInInit.kt new file mode 100644 index 00000000000..95736ea6392 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/VarInInit.kt @@ -0,0 +1,8 @@ +// FIR_IDENTICAL +class Some(var foo: Int) { + init { + if (foo < 0) { + foo = 0 + } + } +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/firProblems/VarInInit.txt b/compiler/testData/ir/irText/firProblems/VarInInit.txt new file mode 100644 index 00000000000..da4d2165685 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/VarInInit.txt @@ -0,0 +1,52 @@ +FILE fqName: fileName:/VarInInit.kt + CLASS CLASS name:Some modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Some + CONSTRUCTOR visibility:public <> (foo:kotlin.Int) returnType:.Some [primary] + VALUE_PARAMETER name:foo index:0 type:kotlin.Int + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Some modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:foo visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:foo type:kotlin.Int visibility:private + EXPRESSION_BODY + GET_VAR 'foo: kotlin.Int declared in .Some.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Some) returnType:kotlin.Int + correspondingProperty: PROPERTY name:foo visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Some + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Some' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:foo type:kotlin.Int visibility:private' type=kotlin.Int origin=null + receiver: GET_VAR ': .Some declared in .Some.' type=.Some origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Some, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:foo visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Some + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:foo type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Some declared in .Some.' type=.Some origin=null + value: GET_VAR ': kotlin.Int declared in .Some.' type=kotlin.Int origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT + arg0: CALL 'public final fun (): kotlin.Int declared in .Some' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR ': .Some declared in .Some' type=.Some origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: BLOCK type=kotlin.Unit origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Some' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Some declared in .Some' type=.Some origin=null + : CONST Int type=kotlin.Int value=0 + 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: 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: 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: type:kotlin.Any diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt index afdbf4eb800..8a5c7d552ac 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt @@ -604,43 +604,43 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.b != null) this.b.funAny() if (this.b != null) this.b.funNullableT() if (this.b != null) this.b.funNullableAny() - if (this.b != null) b - if (this.b != null) b.equals(null) - if (this.b != null) b.propT - if (this.b != null) b.propAny - if (this.b != null) b.propNullableT - if (this.b != null) b.propNullableAny - if (this.b != null) b.funT() - if (this.b != null) b.funAny() - if (this.b != null) b.funNullableT() - if (this.b != null) b.funNullableAny() + if (this.b != null) b + if (this.b != null) b.equals(null) + if (this.b != null) b.propT + if (this.b != null) b.propAny + if (this.b != null) b.propNullableT + if (this.b != null) b.propNullableAny + if (this.b != null) b.funT() + if (this.b != null) b.funAny() + if (this.b != null) b.funNullableT() + if (this.b != null) b.funNullableAny() if (b != null) this.b - if (b != null) this.b.equals(null) + if (b != null) this.b.equals(null) if (b != null) this.b.propT - if (b != null) this.b.propAny + if (b != null) this.b.propAny if (b != null) this.b.propNullableT if (b != null) this.b.propNullableAny if (b != null) this.b.funT() - if (b != null) this.b.funAny() + if (b != null) this.b.funAny() if (b != null) this.b.funNullableT() if (b != null) this.b.funNullableAny() - if (b != null || this.b != null) b.equals(null) - if (b != null || this.b != null) b.propT - if (b != null || this.b != null) b.propAny - if (b != null || this.b != null) b.propNullableT - if (b != null || this.b != null) b.propNullableAny - if (b != null || this.b != null) b.funT() - if (b != null || this.b != null) b.funAny() - if (b != null || this.b != null) b.funNullableT() - if (b != null || this.b != null) b.funNullableAny() - if (b != null || this.b != null) b - if (b != null || this.b != null) this.b.equals(null) + if (b != null || this.b != null) b.equals(null) + if (b != null || this.b != null) b.propT + if (b != null || this.b != null) b.propAny + if (b != null || this.b != null) b.propNullableT + if (b != null || this.b != null) b.propNullableAny + if (b != null || this.b != null) b.funT() + if (b != null || this.b != null) b.funAny() + if (b != null || this.b != null) b.funNullableT() + if (b != null || this.b != null) b.funNullableAny() + if (b != null || this.b != null) b + if (b != null || this.b != null) this.b.equals(null) if (b != null || this.b != null) this.b.propT - if (b != null || this.b != null) this.b.propAny + if (b != null || this.b != null) this.b.propAny if (b != null || this.b != null) this.b.propNullableT if (b != null || this.b != null) this.b.propNullableAny if (b != null || this.b != null) this.b.funT() - if (b != null || this.b != null) this.b.funAny() + if (b != null || this.b != null) this.b.funAny() if (b != null || this.b != null) this.b.funNullableT() if (b != null || this.b != null) this.b.funNullableAny() if (b != null || this.b != null) this.b @@ -673,43 +673,43 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.c != null) this.c.funNullableT() if (this.c != null) this.c.funNullableAny() if (this.c != null) this.c - if (c != null) this.c.equals(null) + if (c != null) this.c.equals(null) if (c != null) this.c.propT - if (c != null) this.c.propAny + if (c != null) this.c.propAny if (c != null) this.c.propNullableT if (c != null) this.c.propNullableAny if (c != null) this.c.funT() - if (c != null) this.c.funAny() + if (c != null) this.c.funAny() if (c != null) this.c.funNullableT() if (c != null) this.c.funNullableAny() if (c != null) this.c - if (this.c != null) c.equals(null) - if (this.c != null) c.propT - if (this.c != null) c.propAny - if (this.c != null) c.propNullableT - if (this.c != null) c.propNullableAny - if (this.c != null) c.funT() - if (this.c != null) c.funAny() - if (this.c != null) c.funNullableT() - if (this.c != null) c.funNullableAny() - if (this.c != null) c - if (c != null || this.c != null) c.equals(null) - if (c != null || this.c != null) c.propT - if (c != null || this.c != null) c.propAny - if (c != null || this.c != null) c.propNullableT - if (c != null || this.c != null) c.propNullableAny - if (c != null || this.c != null) c.funT() - if (c != null || this.c != null) c.funAny() - if (c != null || this.c != null) c.funNullableT() - if (c != null || this.c != null) c.funNullableAny() - if (c != null || this.c != null) c - if (c != null || this.c != null) this.c.equals(null) + if (this.c != null) c.equals(null) + if (this.c != null) c.propT + if (this.c != null) c.propAny + if (this.c != null) c.propNullableT + if (this.c != null) c.propNullableAny + if (this.c != null) c.funT() + if (this.c != null) c.funAny() + if (this.c != null) c.funNullableT() + if (this.c != null) c.funNullableAny() + if (this.c != null) c + if (c != null || this.c != null) c.equals(null) + if (c != null || this.c != null) c.propT + if (c != null || this.c != null) c.propAny + if (c != null || this.c != null) c.propNullableT + if (c != null || this.c != null) c.propNullableAny + if (c != null || this.c != null) c.funT() + if (c != null || this.c != null) c.funAny() + if (c != null || this.c != null) c.funNullableT() + if (c != null || this.c != null) c.funNullableAny() + if (c != null || this.c != null) c + if (c != null || this.c != null) this.c.equals(null) if (c != null || this.c != null) this.c.propT - if (c != null || this.c != null) this.c.propAny + if (c != null || this.c != null) this.c.propAny if (c != null || this.c != null) this.c.propNullableT if (c != null || this.c != null) this.c.propNullableAny if (c != null || this.c != null) this.c.funT() - if (c != null || this.c != null) this.c.funAny() + if (c != null || this.c != null) this.c.funAny() if (c != null || this.c != null) this.c.funNullableT() if (c != null || this.c != null) this.c.funNullableAny() if (c != null || this.c != null) this.c @@ -744,41 +744,41 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.d != null) this.d if (d != null) this.d.equals(null) if (d != null) this.d.propT - if (d != null) this.d.propAny + if (d != null) this.d.propAny if (d != null) this.d.propNullableT if (d != null) this.d.propNullableAny if (d != null) this.d.funT() - if (d != null) this.d.funAny() + if (d != null) this.d.funAny() if (d != null) this.d.funNullableT() if (d != null) this.d.funNullableAny() if (d != null) this.d - if (this.d != null) d.equals(null) - if (this.d != null) d.propT - if (this.d != null) d.propAny - if (this.d != null) d.propNullableT - if (this.d != null) d.propNullableAny - if (this.d != null) d.funT() - if (this.d != null) d.funAny() - if (this.d != null) d.funNullableT() - if (this.d != null) d.funNullableAny() - if (this.d != null) d - if (d != null || this.d != null) d.equals(null) - if (d != null || this.d != null) d.propT - if (d != null || this.d != null) d.propAny - if (d != null || this.d != null) d.propNullableT - if (d != null || this.d != null) d.propNullableAny - if (d != null || this.d != null) d.funT() - if (d != null || this.d != null) d.funAny() - if (d != null || this.d != null) d.funNullableT() - if (d != null || this.d != null) d.funNullableAny() - if (d != null || this.d != null) d + if (this.d != null) d.equals(null) + if (this.d != null) d.propT + if (this.d != null) d.propAny + if (this.d != null) d.propNullableT + if (this.d != null) d.propNullableAny + if (this.d != null) d.funT() + if (this.d != null) d.funAny() + if (this.d != null) d.funNullableT() + if (this.d != null) d.funNullableAny() + if (this.d != null) d + if (d != null || this.d != null) d.equals(null) + if (d != null || this.d != null) d.propT + if (d != null || this.d != null) d.propAny + if (d != null || this.d != null) d.propNullableT + if (d != null || this.d != null) d.propNullableAny + if (d != null || this.d != null) d.funT() + if (d != null || this.d != null) d.funAny() + if (d != null || this.d != null) d.funNullableT() + if (d != null || this.d != null) d.funNullableAny() + if (d != null || this.d != null) d if (d != null || this.d != null) this.d.equals(null) if (d != null || this.d != null) this.d.propT - if (d != null || this.d != null) this.d.propAny + if (d != null || this.d != null) this.d.propAny if (d != null || this.d != null) this.d.propNullableT if (d != null || this.d != null) this.d.propNullableAny if (d != null || this.d != null) this.d.funT() - if (d != null || this.d != null) this.d.funAny() + if (d != null || this.d != null) this.d.funAny() if (d != null || this.d != null) this.d.funNullableT() if (d != null || this.d != null) this.d.funNullableAny() if (d != null || this.d != null) this.d @@ -811,43 +811,43 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.e != null) this.e.funNullableT() if (this.e != null) this.e.funNullableAny() if (this.e != null) this.e - if (this.e != null) e.equals(null) - if (this.e != null) e.propT - if (this.e != null) e.propAny - if (this.e != null) e.propNullableT - if (this.e != null) e.propNullableAny - if (this.e != null) e.funT() - if (this.e != null) e.funAny() - if (this.e != null) e.funNullableT() - if (this.e != null) e.funNullableAny() - if (this.e != null) e - if (e != null) this.e.equals(null) + if (this.e != null) e.equals(null) + if (this.e != null) e.propT + if (this.e != null) e.propAny + if (this.e != null) e.propNullableT + if (this.e != null) e.propNullableAny + if (this.e != null) e.funT() + if (this.e != null) e.funAny() + if (this.e != null) e.funNullableT() + if (this.e != null) e.funNullableAny() + if (this.e != null) e + if (e != null) this.e.equals(null) if (e != null) this.e.propT - if (e != null) this.e.propAny + if (e != null) this.e.propAny if (e != null) this.e.propNullableT if (e != null) this.e.propNullableAny if (e != null) this.e.funT() - if (e != null) this.e.funAny() + if (e != null) this.e.funAny() if (e != null) this.e.funNullableT() if (e != null) this.e.funNullableAny() if (e != null) this.e - if (e != null || this.e != null) e.equals(null) - if (e != null || this.e != null) e.propT - if (e != null || this.e != null) e.propAny - if (e != null || this.e != null) e.propNullableT - if (e != null || this.e != null) e.propNullableAny - if (e != null || this.e != null) e.funT() - if (e != null || this.e != null) e.funAny() - if (e != null || this.e != null) e.funNullableT() - if (e != null || this.e != null) e.funNullableAny() - if (e != null || this.e != null) e - if (e != null || this.e != null) this.e.equals(null) + if (e != null || this.e != null) e.equals(null) + if (e != null || this.e != null) e.propT + if (e != null || this.e != null) e.propAny + if (e != null || this.e != null) e.propNullableT + if (e != null || this.e != null) e.propNullableAny + if (e != null || this.e != null) e.funT() + if (e != null || this.e != null) e.funAny() + if (e != null || this.e != null) e.funNullableT() + if (e != null || this.e != null) e.funNullableAny() + if (e != null || this.e != null) e + if (e != null || this.e != null) this.e.equals(null) if (e != null || this.e != null) this.e.propT - if (e != null || this.e != null) this.e.propAny + if (e != null || this.e != null) this.e.propAny if (e != null || this.e != null) this.e.propNullableT if (e != null || this.e != null) this.e.propNullableAny if (e != null || this.e != null) this.e.funT() - if (e != null || this.e != null) this.e.funAny() + if (e != null || this.e != null) this.e.funAny() if (e != null || this.e != null) this.e.funNullableT() if (e != null || this.e != null) this.e.funNullableAny() if (e != null || this.e != null) this.e @@ -880,43 +880,43 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.f != null) this.f.funNullableT() if (this.f != null) this.f.funNullableAny() if (this.f != null) this.f - if (this.f != null) f.equals(null) - if (this.f != null) f.propT - if (this.f != null) f.propAny - if (this.f != null) f.propNullableT - if (this.f != null) f.propNullableAny - if (this.f != null) f.funT() - if (this.f != null) f.funAny() - if (this.f != null) f.funNullableT() - if (this.f != null) f.funNullableAny() - if (this.f != null) f - if (f != null) this.f.equals(null) + if (this.f != null) f.equals(null) + if (this.f != null) f.propT + if (this.f != null) f.propAny + if (this.f != null) f.propNullableT + if (this.f != null) f.propNullableAny + if (this.f != null) f.funT() + if (this.f != null) f.funAny() + if (this.f != null) f.funNullableT() + if (this.f != null) f.funNullableAny() + if (this.f != null) f + if (f != null) this.f.equals(null) if (f != null) this.f.propT - if (f != null) this.f.propAny + if (f != null) this.f.propAny if (f != null) this.f.propNullableT if (f != null) this.f.propNullableAny if (f != null) this.f.funT() - if (f != null) this.f.funAny() + if (f != null) this.f.funAny() if (f != null) this.f.funNullableT() if (f != null) this.f.funNullableAny() if (f != null) this.f - if (f != null || this.f != null) f.equals(null) - if (f != null || this.f != null) f.propT - if (f != null || this.f != null) f.propAny - if (f != null || this.f != null) f.propNullableT - if (f != null || this.f != null) f.propNullableAny - if (f != null || this.f != null) f.funT() - if (f != null || this.f != null) f.funAny() - if (f != null || this.f != null) f.funNullableT() - if (f != null || this.f != null) f.funNullableAny() - if (f != null || this.f != null) f - if (f != null || this.f != null) this.f.equals(null) + if (f != null || this.f != null) f.equals(null) + if (f != null || this.f != null) f.propT + if (f != null || this.f != null) f.propAny + if (f != null || this.f != null) f.propNullableT + if (f != null || this.f != null) f.propNullableAny + if (f != null || this.f != null) f.funT() + if (f != null || this.f != null) f.funAny() + if (f != null || this.f != null) f.funNullableT() + if (f != null || this.f != null) f.funNullableAny() + if (f != null || this.f != null) f + if (f != null || this.f != null) this.f.equals(null) if (f != null || this.f != null) this.f.propT - if (f != null || this.f != null) this.f.propAny + if (f != null || this.f != null) this.f.propAny if (f != null || this.f != null) this.f.propNullableT if (f != null || this.f != null) this.f.propNullableAny if (f != null || this.f != null) this.f.funT() - if (f != null || this.f != null) this.f.funAny() + if (f != null || this.f != null) this.f.funAny() if (f != null || this.f != null) this.f.funNullableT() if (f != null || this.f != null) this.f.funNullableAny() if (f != null || this.f != null) this.f @@ -1648,43 +1648,43 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.b != null) this.b.funNullableT() if (this.b != null) this.b.funNullableAny() if (this.b != null) this.b - if (this.b != null) b.equals(null) - if (this.b != null) b.propT - if (this.b != null) b.propAny - if (this.b != null) b.propNullableT - if (this.b != null) b.propNullableAny - if (this.b != null) b.funT() - if (this.b != null) b.funAny() - if (this.b != null) b.funNullableT() - if (this.b != null) b.funNullableAny() - if (this.b != null) b - if (b != null) this.b.equals(null) + if (this.b != null) b.equals(null) + if (this.b != null) b.propT + if (this.b != null) b.propAny + if (this.b != null) b.propNullableT + if (this.b != null) b.propNullableAny + if (this.b != null) b.funT() + if (this.b != null) b.funAny() + if (this.b != null) b.funNullableT() + if (this.b != null) b.funNullableAny() + if (this.b != null) b + if (b != null) this.b.equals(null) if (b != null) this.b.propT - if (b != null) this.b.propAny + if (b != null) this.b.propAny if (b != null) this.b.propNullableT if (b != null) this.b.propNullableAny if (b != null) this.b.funT() - if (b != null) this.b.funAny() + if (b != null) this.b.funAny() if (b != null) this.b.funNullableT() if (b != null) this.b.funNullableAny() if (b != null) this.b - if (b != null || this.b != null) b.equals(null) - if (b != null || this.b != null) b.propT - if (b != null || this.b != null) b.propAny - if (b != null || this.b != null) b.propNullableT - if (b != null || this.b != null) b.propNullableAny - if (b != null || this.b != null) b.funT() - if (b != null || this.b != null) b.funAny() - if (b != null || this.b != null) b.funNullableT() - if (b != null || this.b != null) b.funNullableAny() - if (b != null || this.b != null) b - if (b != null || this.b != null) this.b.equals(null) + if (b != null || this.b != null) b.equals(null) + if (b != null || this.b != null) b.propT + if (b != null || this.b != null) b.propAny + if (b != null || this.b != null) b.propNullableT + if (b != null || this.b != null) b.propNullableAny + if (b != null || this.b != null) b.funT() + if (b != null || this.b != null) b.funAny() + if (b != null || this.b != null) b.funNullableT() + if (b != null || this.b != null) b.funNullableAny() + if (b != null || this.b != null) b + if (b != null || this.b != null) this.b.equals(null) if (b != null || this.b != null) this.b.propT - if (b != null || this.b != null) this.b.propAny + if (b != null || this.b != null) this.b.propAny if (b != null || this.b != null) this.b.propNullableT if (b != null || this.b != null) this.b.propNullableAny if (b != null || this.b != null) this.b.funT() - if (b != null || this.b != null) this.b.funAny() + if (b != null || this.b != null) this.b.funAny() if (b != null || this.b != null) this.b.funNullableT() if (b != null || this.b != null) this.b.funNullableAny() if (b != null || this.b != null) this.b @@ -1717,43 +1717,43 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.c != null) this.c.funNullableT() if (this.c != null) this.c.funNullableAny() if (this.c != null) this.c - if (c != null) this.c.equals(null) + if (c != null) this.c.equals(null) if (c != null) this.c.propT - if (c != null) this.c.propAny + if (c != null) this.c.propAny if (c != null) this.c.propNullableT if (c != null) this.c.propNullableAny if (c != null) this.c.funT() - if (c != null) this.c.funAny() + if (c != null) this.c.funAny() if (c != null) this.c.funNullableT() if (c != null) this.c.funNullableAny() if (c != null) this.c - if (this.c != null) c.equals(null) - if (this.c != null) c.propT - if (this.c != null) c.propAny - if (this.c != null) c.propNullableT - if (this.c != null) c.propNullableAny - if (this.c != null) c.funT() - if (this.c != null) c.funAny() - if (this.c != null) c.funNullableT() - if (this.c != null) c.funNullableAny() - if (this.c != null) c - if (c != null || this.c != null) c.equals(null) - if (c != null || this.c != null) c.propT - if (c != null || this.c != null) c.propAny - if (c != null || this.c != null) c.propNullableT - if (c != null || this.c != null) c.propNullableAny - if (c != null || this.c != null) c.funT() - if (c != null || this.c != null) c.funAny() - if (c != null || this.c != null) c.funNullableT() - if (c != null || this.c != null) c.funNullableAny() - if (c != null || this.c != null) c - if (c != null || this.c != null) this.c.equals(null) + if (this.c != null) c.equals(null) + if (this.c != null) c.propT + if (this.c != null) c.propAny + if (this.c != null) c.propNullableT + if (this.c != null) c.propNullableAny + if (this.c != null) c.funT() + if (this.c != null) c.funAny() + if (this.c != null) c.funNullableT() + if (this.c != null) c.funNullableAny() + if (this.c != null) c + if (c != null || this.c != null) c.equals(null) + if (c != null || this.c != null) c.propT + if (c != null || this.c != null) c.propAny + if (c != null || this.c != null) c.propNullableT + if (c != null || this.c != null) c.propNullableAny + if (c != null || this.c != null) c.funT() + if (c != null || this.c != null) c.funAny() + if (c != null || this.c != null) c.funNullableT() + if (c != null || this.c != null) c.funNullableAny() + if (c != null || this.c != null) c + if (c != null || this.c != null) this.c.equals(null) if (c != null || this.c != null) this.c.propT - if (c != null || this.c != null) this.c.propAny + if (c != null || this.c != null) this.c.propAny if (c != null || this.c != null) this.c.propNullableT if (c != null || this.c != null) this.c.propNullableAny if (c != null || this.c != null) this.c.funT() - if (c != null || this.c != null) this.c.funAny() + if (c != null || this.c != null) this.c.funAny() if (c != null || this.c != null) this.c.funNullableT() if (c != null || this.c != null) this.c.funNullableAny() if (c != null || this.c != null) this.c @@ -1788,41 +1788,41 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.d != null) this.d if (d != null) this.d.equals(null) if (d != null) this.d.propT - if (d != null) this.d.propAny + if (d != null) this.d.propAny if (d != null) this.d.propNullableT if (d != null) this.d.propNullableAny if (d != null) this.d.funT() - if (d != null) this.d.funAny() + if (d != null) this.d.funAny() if (d != null) this.d.funNullableT() if (d != null) this.d.funNullableAny() if (d != null) this.d - if (this.d != null) d.equals(null) - if (this.d != null) d.propT - if (this.d != null) d.propAny - if (this.d != null) d.propNullableT - if (this.d != null) d.propNullableAny - if (this.d != null) d.funT() - if (this.d != null) d.funAny() - if (this.d != null) d.funNullableT() - if (this.d != null) d.funNullableAny() - if (this.d != null) d - if (d != null || this.d != null) d.equals(null) - if (d != null || this.d != null) d.propT - if (d != null || this.d != null) d.propAny - if (d != null || this.d != null) d.propNullableT - if (d != null || this.d != null) d.propNullableAny - if (d != null || this.d != null) d.funT() - if (d != null || this.d != null) d.funAny() - if (d != null || this.d != null) d.funNullableT() - if (d != null || this.d != null) d.funNullableAny() - if (d != null || this.d != null) d + if (this.d != null) d.equals(null) + if (this.d != null) d.propT + if (this.d != null) d.propAny + if (this.d != null) d.propNullableT + if (this.d != null) d.propNullableAny + if (this.d != null) d.funT() + if (this.d != null) d.funAny() + if (this.d != null) d.funNullableT() + if (this.d != null) d.funNullableAny() + if (this.d != null) d + if (d != null || this.d != null) d.equals(null) + if (d != null || this.d != null) d.propT + if (d != null || this.d != null) d.propAny + if (d != null || this.d != null) d.propNullableT + if (d != null || this.d != null) d.propNullableAny + if (d != null || this.d != null) d.funT() + if (d != null || this.d != null) d.funAny() + if (d != null || this.d != null) d.funNullableT() + if (d != null || this.d != null) d.funNullableAny() + if (d != null || this.d != null) d if (d != null || this.d != null) this.d.equals(null) if (d != null || this.d != null) this.d.propT - if (d != null || this.d != null) this.d.propAny + if (d != null || this.d != null) this.d.propAny if (d != null || this.d != null) this.d.propNullableT if (d != null || this.d != null) this.d.propNullableAny if (d != null || this.d != null) this.d.funT() - if (d != null || this.d != null) this.d.funAny() + if (d != null || this.d != null) this.d.funAny() if (d != null || this.d != null) this.d.funNullableT() if (d != null || this.d != null) this.d.funNullableAny() if (d != null || this.d != null) this.d @@ -1855,43 +1855,43 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.e != null) this.e.funNullableT() if (this.e != null) this.e.funNullableAny() if (this.e != null) this.e - if (this.e != null) e.equals(null) - if (this.e != null) e.propT - if (this.e != null) e.propAny - if (this.e != null) e.propNullableT - if (this.e != null) e.propNullableAny - if (this.e != null) e.funT() - if (this.e != null) e.funAny() - if (this.e != null) e.funNullableT() - if (this.e != null) e.funNullableAny() - if (this.e != null) e - if (e != null) this.e.equals(null) + if (this.e != null) e.equals(null) + if (this.e != null) e.propT + if (this.e != null) e.propAny + if (this.e != null) e.propNullableT + if (this.e != null) e.propNullableAny + if (this.e != null) e.funT() + if (this.e != null) e.funAny() + if (this.e != null) e.funNullableT() + if (this.e != null) e.funNullableAny() + if (this.e != null) e + if (e != null) this.e.equals(null) if (e != null) this.e.propT - if (e != null) this.e.propAny + if (e != null) this.e.propAny if (e != null) this.e.propNullableT if (e != null) this.e.propNullableAny if (e != null) this.e.funT() - if (e != null) this.e.funAny() + if (e != null) this.e.funAny() if (e != null) this.e.funNullableT() if (e != null) this.e.funNullableAny() if (e != null) this.e - if (e != null || this.e != null) e.equals(null) - if (e != null || this.e != null) e.propT - if (e != null || this.e != null) e.propAny - if (e != null || this.e != null) e.propNullableT - if (e != null || this.e != null) e.propNullableAny - if (e != null || this.e != null) e.funT() - if (e != null || this.e != null) e.funAny() - if (e != null || this.e != null) e.funNullableT() - if (e != null || this.e != null) e.funNullableAny() - if (e != null || this.e != null) e - if (e != null || this.e != null) this.e.equals(null) + if (e != null || this.e != null) e.equals(null) + if (e != null || this.e != null) e.propT + if (e != null || this.e != null) e.propAny + if (e != null || this.e != null) e.propNullableT + if (e != null || this.e != null) e.propNullableAny + if (e != null || this.e != null) e.funT() + if (e != null || this.e != null) e.funAny() + if (e != null || this.e != null) e.funNullableT() + if (e != null || this.e != null) e.funNullableAny() + if (e != null || this.e != null) e + if (e != null || this.e != null) this.e.equals(null) if (e != null || this.e != null) this.e.propT - if (e != null || this.e != null) this.e.propAny + if (e != null || this.e != null) this.e.propAny if (e != null || this.e != null) this.e.propNullableT if (e != null || this.e != null) this.e.propNullableAny if (e != null || this.e != null) this.e.funT() - if (e != null || this.e != null) this.e.funAny() + if (e != null || this.e != null) this.e.funAny() if (e != null || this.e != null) this.e.funNullableT() if (e != null || this.e != null) this.e.funNullableAny() if (e != null || this.e != null) this.e @@ -1924,43 +1924,43 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.f != null) this.f.funNullableT() if (this.f != null) this.f.funNullableAny() if (this.f != null) this.f - if (this.f != null) f.equals(null) - if (this.f != null) f.propT - if (this.f != null) f.propAny - if (this.f != null) f.propNullableT - if (this.f != null) f.propNullableAny - if (this.f != null) f.funT() - if (this.f != null) f.funAny() - if (this.f != null) f.funNullableT() - if (this.f != null) f.funNullableAny() - if (this.f != null) f - if (f != null) this.f.equals(null) + if (this.f != null) f.equals(null) + if (this.f != null) f.propT + if (this.f != null) f.propAny + if (this.f != null) f.propNullableT + if (this.f != null) f.propNullableAny + if (this.f != null) f.funT() + if (this.f != null) f.funAny() + if (this.f != null) f.funNullableT() + if (this.f != null) f.funNullableAny() + if (this.f != null) f + if (f != null) this.f.equals(null) if (f != null) this.f.propT - if (f != null) this.f.propAny + if (f != null) this.f.propAny if (f != null) this.f.propNullableT if (f != null) this.f.propNullableAny if (f != null) this.f.funT() - if (f != null) this.f.funAny() + if (f != null) this.f.funAny() if (f != null) this.f.funNullableT() if (f != null) this.f.funNullableAny() if (f != null) this.f - if (f != null || this.f != null) f.equals(null) - if (f != null || this.f != null) f.propT - if (f != null || this.f != null) f.propAny - if (f != null || this.f != null) f.propNullableT - if (f != null || this.f != null) f.propNullableAny - if (f != null || this.f != null) f.funT() - if (f != null || this.f != null) f.funAny() - if (f != null || this.f != null) f.funNullableT() - if (f != null || this.f != null) f.funNullableAny() - if (f != null || this.f != null) f - if (f != null || this.f != null) this.f.equals(null) + if (f != null || this.f != null) f.equals(null) + if (f != null || this.f != null) f.propT + if (f != null || this.f != null) f.propAny + if (f != null || this.f != null) f.propNullableT + if (f != null || this.f != null) f.propNullableAny + if (f != null || this.f != null) f.funT() + if (f != null || this.f != null) f.funAny() + if (f != null || this.f != null) f.funNullableT() + if (f != null || this.f != null) f.funNullableAny() + if (f != null || this.f != null) f + if (f != null || this.f != null) this.f.equals(null) if (f != null || this.f != null) this.f.propT - if (f != null || this.f != null) this.f.propAny + if (f != null || this.f != null) this.f.propAny if (f != null || this.f != null) this.f.propNullableT if (f != null || this.f != null) this.f.propNullableAny if (f != null || this.f != null) this.f.funT() - if (f != null || this.f != null) this.f.funAny() + if (f != null || this.f != null) this.f.funAny() if (f != null || this.f != null) this.f.funNullableT() if (f != null || this.f != null) this.f.funNullableAny() if (f != null || this.f != null) this.f @@ -2694,43 +2694,43 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.b != null) this.b.funNullableT() if (this.b != null) this.b.funNullableAny() if (this.b != null) this.b - if (this.b != null) b.equals(null) - if (this.b != null) b.propT - if (this.b != null) b.propAny - if (this.b != null) b.propNullableT - if (this.b != null) b.propNullableAny - if (this.b != null) b.funT() - if (this.b != null) b.funAny() - if (this.b != null) b.funNullableT() - if (this.b != null) b.funNullableAny() - if (this.b != null) b - if (b != null) this.b.equals(null) + if (this.b != null) b.equals(null) + if (this.b != null) b.propT + if (this.b != null) b.propAny + if (this.b != null) b.propNullableT + if (this.b != null) b.propNullableAny + if (this.b != null) b.funT() + if (this.b != null) b.funAny() + if (this.b != null) b.funNullableT() + if (this.b != null) b.funNullableAny() + if (this.b != null) b + if (b != null) this.b.equals(null) if (b != null) this.b.propT - if (b != null) this.b.propAny + if (b != null) this.b.propAny if (b != null) this.b.propNullableT if (b != null) this.b.propNullableAny if (b != null) this.b.funT() - if (b != null) this.b.funAny() + if (b != null) this.b.funAny() if (b != null) this.b.funNullableT() if (b != null) this.b.funNullableAny() if (b != null) this.b - if (b != null || this.b != null) b.equals(null) - if (b != null || this.b != null) b.propT - if (b != null || this.b != null) b.propAny - if (b != null || this.b != null) b.propNullableT - if (b != null || this.b != null) b.propNullableAny - if (b != null || this.b != null) b.funT() - if (b != null || this.b != null) b.funAny() - if (b != null || this.b != null) b.funNullableT() - if (b != null || this.b != null) b.funNullableAny() - if (b != null || this.b != null) b - if (b != null || this.b != null) this.b.equals(null) + if (b != null || this.b != null) b.equals(null) + if (b != null || this.b != null) b.propT + if (b != null || this.b != null) b.propAny + if (b != null || this.b != null) b.propNullableT + if (b != null || this.b != null) b.propNullableAny + if (b != null || this.b != null) b.funT() + if (b != null || this.b != null) b.funAny() + if (b != null || this.b != null) b.funNullableT() + if (b != null || this.b != null) b.funNullableAny() + if (b != null || this.b != null) b + if (b != null || this.b != null) this.b.equals(null) if (b != null || this.b != null) this.b.propT - if (b != null || this.b != null) this.b.propAny + if (b != null || this.b != null) this.b.propAny if (b != null || this.b != null) this.b.propNullableT if (b != null || this.b != null) this.b.propNullableAny if (b != null || this.b != null) this.b.funT() - if (b != null || this.b != null) this.b.funAny() + if (b != null || this.b != null) this.b.funAny() if (b != null || this.b != null) this.b.funNullableT() if (b != null || this.b != null) this.b.funNullableAny() if (b != null || this.b != null) this.b @@ -2763,43 +2763,43 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.c != null) this.c.funNullableT() if (this.c != null) this.c.funNullableAny() if (this.c != null) this.c - if (c != null) this.c.equals(null) + if (c != null) this.c.equals(null) if (c != null) this.c.propT - if (c != null) this.c.propAny + if (c != null) this.c.propAny if (c != null) this.c.propNullableT if (c != null) this.c.propNullableAny if (c != null) this.c.funT() - if (c != null) this.c.funAny() + if (c != null) this.c.funAny() if (c != null) this.c.funNullableT() if (c != null) this.c.funNullableAny() if (c != null) this.c - if (this.c != null) c.equals(null) - if (this.c != null) c.propT - if (this.c != null) c.propAny - if (this.c != null) c.propNullableT - if (this.c != null) c.propNullableAny - if (this.c != null) c.funT() - if (this.c != null) c.funAny() - if (this.c != null) c.funNullableT() - if (this.c != null) c.funNullableAny() - if (this.c != null) c - if (c != null || this.c != null) c.equals(null) - if (c != null || this.c != null) c.propT - if (c != null || this.c != null) c.propAny - if (c != null || this.c != null) c.propNullableT - if (c != null || this.c != null) c.propNullableAny - if (c != null || this.c != null) c.funT() - if (c != null || this.c != null) c.funAny() - if (c != null || this.c != null) c.funNullableT() - if (c != null || this.c != null) c.funNullableAny() - if (c != null || this.c != null) c - if (c != null || this.c != null) this.c.equals(null) + if (this.c != null) c.equals(null) + if (this.c != null) c.propT + if (this.c != null) c.propAny + if (this.c != null) c.propNullableT + if (this.c != null) c.propNullableAny + if (this.c != null) c.funT() + if (this.c != null) c.funAny() + if (this.c != null) c.funNullableT() + if (this.c != null) c.funNullableAny() + if (this.c != null) c + if (c != null || this.c != null) c.equals(null) + if (c != null || this.c != null) c.propT + if (c != null || this.c != null) c.propAny + if (c != null || this.c != null) c.propNullableT + if (c != null || this.c != null) c.propNullableAny + if (c != null || this.c != null) c.funT() + if (c != null || this.c != null) c.funAny() + if (c != null || this.c != null) c.funNullableT() + if (c != null || this.c != null) c.funNullableAny() + if (c != null || this.c != null) c + if (c != null || this.c != null) this.c.equals(null) if (c != null || this.c != null) this.c.propT - if (c != null || this.c != null) this.c.propAny + if (c != null || this.c != null) this.c.propAny if (c != null || this.c != null) this.c.propNullableT if (c != null || this.c != null) this.c.propNullableAny if (c != null || this.c != null) this.c.funT() - if (c != null || this.c != null) this.c.funAny() + if (c != null || this.c != null) this.c.funAny() if (c != null || this.c != null) this.c.funNullableT() if (c != null || this.c != null) this.c.funNullableAny() if (c != null || this.c != null) this.c @@ -2834,41 +2834,41 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.d != null) this.d if (d != null) this.d.equals(null) if (d != null) this.d.propT - if (d != null) this.d.propAny + if (d != null) this.d.propAny if (d != null) this.d.propNullableT if (d != null) this.d.propNullableAny if (d != null) this.d.funT() - if (d != null) this.d.funAny() + if (d != null) this.d.funAny() if (d != null) this.d.funNullableT() if (d != null) this.d.funNullableAny() if (d != null) this.d - if (this.d != null) d.equals(null) - if (this.d != null) d.propT - if (this.d != null) d.propAny - if (this.d != null) d.propNullableT - if (this.d != null) d.propNullableAny - if (this.d != null) d.funT() - if (this.d != null) d.funAny() - if (this.d != null) d.funNullableT() - if (this.d != null) d.funNullableAny() - if (this.d != null) d - if (d != null || this.d != null) d.equals(null) - if (d != null || this.d != null) d.propT - if (d != null || this.d != null) d.propAny - if (d != null || this.d != null) d.propNullableT - if (d != null || this.d != null) d.propNullableAny - if (d != null || this.d != null) d.funT() - if (d != null || this.d != null) d.funAny() - if (d != null || this.d != null) d.funNullableT() - if (d != null || this.d != null) d.funNullableAny() - if (d != null || this.d != null) d + if (this.d != null) d.equals(null) + if (this.d != null) d.propT + if (this.d != null) d.propAny + if (this.d != null) d.propNullableT + if (this.d != null) d.propNullableAny + if (this.d != null) d.funT() + if (this.d != null) d.funAny() + if (this.d != null) d.funNullableT() + if (this.d != null) d.funNullableAny() + if (this.d != null) d + if (d != null || this.d != null) d.equals(null) + if (d != null || this.d != null) d.propT + if (d != null || this.d != null) d.propAny + if (d != null || this.d != null) d.propNullableT + if (d != null || this.d != null) d.propNullableAny + if (d != null || this.d != null) d.funT() + if (d != null || this.d != null) d.funAny() + if (d != null || this.d != null) d.funNullableT() + if (d != null || this.d != null) d.funNullableAny() + if (d != null || this.d != null) d if (d != null || this.d != null) this.d.equals(null) if (d != null || this.d != null) this.d.propT - if (d != null || this.d != null) this.d.propAny + if (d != null || this.d != null) this.d.propAny if (d != null || this.d != null) this.d.propNullableT if (d != null || this.d != null) this.d.propNullableAny if (d != null || this.d != null) this.d.funT() - if (d != null || this.d != null) this.d.funAny() + if (d != null || this.d != null) this.d.funAny() if (d != null || this.d != null) this.d.funNullableT() if (d != null || this.d != null) this.d.funNullableAny() if (d != null || this.d != null) this.d @@ -2901,43 +2901,43 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.e != null) this.e.funNullableT() if (this.e != null) this.e.funNullableAny() if (this.e != null) this.e - if (this.e != null) e.equals(null) - if (this.e != null) e.propT - if (this.e != null) e.propAny - if (this.e != null) e.propNullableT - if (this.e != null) e.propNullableAny - if (this.e != null) e.funT() - if (this.e != null) e.funAny() - if (this.e != null) e.funNullableT() - if (this.e != null) e.funNullableAny() - if (this.e != null) e - if (e != null) this.e.equals(null) + if (this.e != null) e.equals(null) + if (this.e != null) e.propT + if (this.e != null) e.propAny + if (this.e != null) e.propNullableT + if (this.e != null) e.propNullableAny + if (this.e != null) e.funT() + if (this.e != null) e.funAny() + if (this.e != null) e.funNullableT() + if (this.e != null) e.funNullableAny() + if (this.e != null) e + if (e != null) this.e.equals(null) if (e != null) this.e.propT - if (e != null) this.e.propAny + if (e != null) this.e.propAny if (e != null) this.e.propNullableT if (e != null) this.e.propNullableAny if (e != null) this.e.funT() - if (e != null) this.e.funAny() + if (e != null) this.e.funAny() if (e != null) this.e.funNullableT() if (e != null) this.e.funNullableAny() if (e != null) this.e - if (e != null || this.e != null) e.equals(null) - if (e != null || this.e != null) e.propT - if (e != null || this.e != null) e.propAny - if (e != null || this.e != null) e.propNullableT - if (e != null || this.e != null) e.propNullableAny - if (e != null || this.e != null) e.funT() - if (e != null || this.e != null) e.funAny() - if (e != null || this.e != null) e.funNullableT() - if (e != null || this.e != null) e.funNullableAny() - if (e != null || this.e != null) e - if (e != null || this.e != null) this.e.equals(null) + if (e != null || this.e != null) e.equals(null) + if (e != null || this.e != null) e.propT + if (e != null || this.e != null) e.propAny + if (e != null || this.e != null) e.propNullableT + if (e != null || this.e != null) e.propNullableAny + if (e != null || this.e != null) e.funT() + if (e != null || this.e != null) e.funAny() + if (e != null || this.e != null) e.funNullableT() + if (e != null || this.e != null) e.funNullableAny() + if (e != null || this.e != null) e + if (e != null || this.e != null) this.e.equals(null) if (e != null || this.e != null) this.e.propT - if (e != null || this.e != null) this.e.propAny + if (e != null || this.e != null) this.e.propAny if (e != null || this.e != null) this.e.propNullableT if (e != null || this.e != null) this.e.propNullableAny if (e != null || this.e != null) this.e.funT() - if (e != null || this.e != null) this.e.funAny() + if (e != null || this.e != null) this.e.funAny() if (e != null || this.e != null) this.e.funNullableT() if (e != null || this.e != null) this.e.funNullableAny() if (e != null || this.e != null) this.e @@ -2970,43 +2970,43 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.f != null) this.f.funNullableT() if (this.f != null) this.f.funNullableAny() if (this.f != null) this.f - if (this.f != null) f.equals(null) - if (this.f != null) f.propT - if (this.f != null) f.propAny - if (this.f != null) f.propNullableT - if (this.f != null) f.propNullableAny - if (this.f != null) f.funT() - if (this.f != null) f.funAny() - if (this.f != null) f.funNullableT() - if (this.f != null) f.funNullableAny() - if (this.f != null) f - if (f != null) this.f.equals(null) + if (this.f != null) f.equals(null) + if (this.f != null) f.propT + if (this.f != null) f.propAny + if (this.f != null) f.propNullableT + if (this.f != null) f.propNullableAny + if (this.f != null) f.funT() + if (this.f != null) f.funAny() + if (this.f != null) f.funNullableT() + if (this.f != null) f.funNullableAny() + if (this.f != null) f + if (f != null) this.f.equals(null) if (f != null) this.f.propT - if (f != null) this.f.propAny + if (f != null) this.f.propAny if (f != null) this.f.propNullableT if (f != null) this.f.propNullableAny if (f != null) this.f.funT() - if (f != null) this.f.funAny() + if (f != null) this.f.funAny() if (f != null) this.f.funNullableT() if (f != null) this.f.funNullableAny() if (f != null) this.f - if (f != null || this.f != null) f.equals(null) - if (f != null || this.f != null) f.propT - if (f != null || this.f != null) f.propAny - if (f != null || this.f != null) f.propNullableT - if (f != null || this.f != null) f.propNullableAny - if (f != null || this.f != null) f.funT() - if (f != null || this.f != null) f.funAny() - if (f != null || this.f != null) f.funNullableT() - if (f != null || this.f != null) f.funNullableAny() - if (f != null || this.f != null) f - if (f != null || this.f != null) this.f.equals(null) + if (f != null || this.f != null) f.equals(null) + if (f != null || this.f != null) f.propT + if (f != null || this.f != null) f.propAny + if (f != null || this.f != null) f.propNullableT + if (f != null || this.f != null) f.propNullableAny + if (f != null || this.f != null) f.funT() + if (f != null || this.f != null) f.funAny() + if (f != null || this.f != null) f.funNullableT() + if (f != null || this.f != null) f.funNullableAny() + if (f != null || this.f != null) f + if (f != null || this.f != null) this.f.equals(null) if (f != null || this.f != null) this.f.propT - if (f != null || this.f != null) this.f.propAny + if (f != null || this.f != null) this.f.propAny if (f != null || this.f != null) this.f.propNullableT if (f != null || this.f != null) this.f.propNullableAny if (f != null || this.f != null) this.f.funT() - if (f != null || this.f != null) this.f.funAny() + if (f != null || this.f != null) this.f.funAny() if (f != null || this.f != null) this.f.funNullableT() if (f != null || this.f != null) this.f.funNullableAny() if (f != null || this.f != null) this.f diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 01db87ff932..1d19f9b1e6e 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -1810,6 +1810,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { public void testV8ArrayToList() throws Exception { runTest("compiler/testData/ir/irText/firProblems/V8ArrayToList.kt"); } + + @TestMetadata("VarInInit.kt") + public void testVarInInit() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/VarInInit.kt"); + } } @TestMetadata("compiler/testData/ir/irText/lambdas")