From 3b1a6389ab240f113cfb0b17cf58aa52c9c9ec3b Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Thu, 5 Nov 2020 23:27:19 +0300 Subject: [PATCH] [IR] update testdata after rebase --- .../classes/dataClassWithArrayMembers.kt.txt | 11 ++- .../ir/irText/classes/dataClasses.kt.txt | 13 ++- .../parameters/dataClassMembers.kt.txt | 6 +- .../constructorWithAdaptedArguments.kt.txt | 1 - .../suspendConversion.kt.txt | 1 - .../withArgumentAdaptationAndReceiver.kt.txt | 2 - .../nullCheckOnGenericLambdaReturn.kt.txt | 4 +- .../sam/samConversionToGeneric.kt.txt | 4 +- ...pendConversionOnArbitraryExpression.kt.txt | 92 ++++++++++++------- .../lambdas/destructuringInLambda.kt.txt | 4 +- .../typeParametersInImplicitCast.kt.txt | 4 +- .../ir/irText/stubs/builtinMap.kt.txt | 2 +- ...ullabilityInDestructuringAssignment.kt.txt | 24 ++--- .../enhancedNullabilityInForLoop.kt.txt | 26 +++--- 14 files changed, 120 insertions(+), 74 deletions(-) diff --git a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.kt.txt b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.kt.txt index 6aa615d168a..627395f11ae 100644 --- a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.kt.txt @@ -113,7 +113,16 @@ dataClassArrayMemberToString(arg0 = #doubleArray) + } override fun hashCode(): Int { - return dataClassArrayMemberHashCode(arg0 = #stringArray).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #charArray)).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #booleanArray)).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #byteArray)).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #shortArray)).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #intArray)).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #longArray)).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #floatArray)).times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #doubleArray)) + var result: Int = dataClassArrayMemberHashCode(arg0 = #stringArray) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #charArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #booleanArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #byteArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #shortArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #intArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #longArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #floatArray)) + result = result.times(other = 31).plus(other = dataClassArrayMemberHashCode(arg0 = #doubleArray)) + return result } override operator fun equals(other: Any?): Boolean { diff --git a/compiler/testData/ir/irText/classes/dataClasses.kt.txt b/compiler/testData/ir/irText/classes/dataClasses.kt.txt index 365ccecd75f..2f90fd974eb 100644 --- a/compiler/testData/ir/irText/classes/dataClasses.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses.kt.txt @@ -47,7 +47,10 @@ data class Test1 { } override fun hashCode(): Int { - return #x.hashCode().times(other = 31).plus(other = #y.hashCode()).times(other = 31).plus(other = #z.hashCode()) + var result: Int = #x.hashCode() + result = result.times(other = 31).plus(other = #y.hashCode()) + result = result.times(other = 31).plus(other = #z.hashCode()) + return result } override operator fun equals(other: Any?): Boolean { @@ -181,13 +184,17 @@ data class Test3 { } override fun hashCode(): Int { - return #d.hashCode().times(other = 31).plus(other = when { + var result: Int = #d.hashCode() + result = result.times(other = 31).plus(other = when { EQEQ(arg0 = #dn, arg1 = null) -> 0 true -> #dn.hashCode() - }).times(other = 31).plus(other = #f.hashCode()).times(other = 31).plus(other = when { + }) + result = result.times(other = 31).plus(other = #f.hashCode()) + result = result.times(other = 31).plus(other = when { EQEQ(arg0 = #df, arg1 = null) -> 0 true -> #df.hashCode() }) + return result } override operator fun equals(other: Any?): Boolean { diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt index 97c51aa08c6..ebe8fb1c107 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt.txt @@ -36,10 +36,12 @@ data class Test { } override fun hashCode(): Int { - return when { + var result: Int = when { EQEQ(arg0 = #x, arg1 = null) -> 0 true -> #x.hashCode() - }.times(other = 31).plus(other = #y.hashCode()) + } + result = result.times(other = 31).plus(other = #y.hashCode()) + return result } override operator fun equals(other: Any?): Boolean { diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt index dd0c80c1529..f2c58b93104 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt @@ -58,7 +58,6 @@ fun testInnerClassConstructor(outer: Outer): Any { fun testInnerClassConstructorCapturingOuter(): Any { return use(fn = { //BLOCK - val tmp0_receiver: Outer = TODO("IrConstructorCall") local fun Outer.(p0: Int): Inner { return TODO("IrConstructorCall") } diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt index 89ba234d95b..24cdb8da7dc 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.kt.txt @@ -93,7 +93,6 @@ fun testWithDefaults() { fun testWithBoundReceiver() { useSuspend(fn = { //BLOCK - val tmp0_receiver: C = TODO("IrConstructorCall") local suspend fun C.bar() { receiver.bar() } diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt index a1c811febbe..a81f4d2bffd 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.kt.txt @@ -39,7 +39,6 @@ class Host { fun testBoundReceiverLocalVar() { var h: Host = TODO("IrConstructorCall") use(fn = { //BLOCK - val tmp0_receiver: Host = h local fun Host.withVararg(p0: Int) { receiver.withVararg(xs = [p0]) /*~> Unit */ } @@ -62,7 +61,6 @@ class Host { fun testBoundReceiverExpression() { use(fn = { //BLOCK - val tmp0_receiver: Host = TODO("IrConstructorCall") local fun Host.withVararg(p0: Int) { receiver.withVararg(xs = [p0]) /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt.txt b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt.txt index 5aaa42f70a7..d905244704e 100644 --- a/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt.txt +++ b/compiler/testData/ir/irText/expressions/nullCheckOnGenericLambdaReturn.kt.txt @@ -26,7 +26,7 @@ fun test1(): @FlexibleNullability String? { } fun test2(): String { - return checkT(fn = local fun (): String? { + return checkT<@EnhancedNullability String>(fn = local fun (): @EnhancedNullability String { return nnFoo() } ) /*!! String */ @@ -40,7 +40,7 @@ fun test3(): @FlexibleNullability String? { } fun test4(): String { - return checkTAny(fn = local fun (): String? { + return checkTAny<@EnhancedNullability String>(fn = local fun (): @EnhancedNullability String { return nnFoo() } ) /*!! String */ diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt index 6da8d3ea5da..927108ed90c 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionToGeneric.kt.txt @@ -30,12 +30,12 @@ fun test5(a: Any) { } fun test6(a: Function1) { - bar(j = a /*-> @FlexibleNullability J? */) + bar<@FlexibleNullability T?>(j = a /*-> @FlexibleNullability J<@FlexibleNullability T?>? */) } fun test7(a: Any) { a as Function1 /*~> Unit */ - bar(j = a /*as Function1<@ParameterName(...) T?, T?> */ /*-> @FlexibleNullability J? */) + bar<@FlexibleNullability T?>(j = a /*as Function1<@ParameterName(...) @FlexibleNullability T?, @FlexibleNullability T?> */ /*-> @FlexibleNullability J<@FlexibleNullability T?>? */) } fun test8(efn: @ExtensionFunctionType Function1): J<@FlexibleNullability String?> { diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt index b70dd223235..aacf697d0fe 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.kt.txt @@ -22,129 +22,156 @@ fun produceFun(): Function0 { fun testSimple(fn: Function0) { useSuspend(sfn = { //BLOCK - local suspend fun suspendConversion0() { - fn.invoke() + local suspend fun Function0.suspendConversion0() { + callee.invoke() } + + ::suspendConversion0 }) } fun testSimpleNonVal() { useSuspend(sfn = { //BLOCK - val tmp0: Function0 = produceFun() - local suspend fun suspendConversion1() { - tmp0.invoke() + local suspend fun Function0.suspendConversion0() { + callee.invoke() } + + ::suspendConversion0 }) } fun testExtAsExt(fn: @ExtensionFunctionType Function1) { useSuspendExt(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: Int) { - fn.invoke(p1 = p0) + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testExtAsSimple(fn: @ExtensionFunctionType Function1) { useSuspendArg(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: Int) { - fn.invoke(p1 = p0) + local suspend fun Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testSimpleAsExt(fn: Function1) { useSuspendExt(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: Int) { - fn.invoke(p1 = p0) + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testSimpleAsSimpleT(fn: Function1) { useSuspendArgT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: Int) { - fn.invoke(p1 = p0) + local suspend fun Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testSimpleAsExtT(fn: Function1) { useSuspendExtT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: Int) { - fn.invoke(p1 = p0) + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1) { useSuspendArgT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: Int) { - fn.invoke(p1 = p0) + local suspend fun Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testExtAsExtT(fn: @ExtensionFunctionType Function1) { useSuspendExtT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: Int) { - fn.invoke(p1 = p0) + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: Int) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testSimpleSAsSimpleT(fn: Function1) { useSuspendArgT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: S) { - fn.invoke(p1 = p0) + local suspend fun Function1.suspendConversion0(p0: S) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testSimpleSAsExtT(fn: Function1) { useSuspendExtT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: S) { - fn.invoke(p1 = p0) + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: S) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testExtSAsSimpleT(fn: @ExtensionFunctionType Function1) { useSuspendArgT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: S) { - fn.invoke(p1 = p0) + local suspend fun Function1.suspendConversion0(p0: S) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testExtSAsExtT(fn: @ExtensionFunctionType Function1) { useSuspendExtT(sfn = { //BLOCK - local suspend fun suspendConversion0(p0: S) { - fn.invoke(p1 = p0) + local suspend fun @ExtensionFunctionType Function1.suspendConversion0(p0: S) { + callee.invoke(p1 = p0) } + + ::suspendConversion0 }) } fun testSmartCastWithSuspendConversion(a: Any) { a as Function0 /*~> Unit */ useSuspend(sfn = { //BLOCK - local suspend fun suspendConversion0() { - a /*as Function0 */.invoke() + local suspend fun Function0.suspendConversion0() { + callee.invoke() } + + ::suspendConversion0 }) } @@ -152,11 +179,12 @@ fun testSmartCastOnVarWithSuspendConversion(a: Any) { var b: Any = a b as Function0 /*~> Unit */ useSuspend(sfn = { //BLOCK - val tmp0: Function0 = b /*as Function0 */ - local suspend fun suspendConversion1() { - tmp0.invoke() + local suspend fun Function0.suspendConversion0() { + callee.invoke() } + + ::suspendConversion0 }) } diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt index ad8b381ab8d..eb461e9e0e7 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.kt.txt @@ -36,7 +36,9 @@ data class A { } override fun hashCode(): Int { - return #x.hashCode().times(other = 31).plus(other = #y.hashCode()) + var result: Int = #x.hashCode() + result = result.times(other = 31).plus(other = #y.hashCode()) + return result } override operator fun equals(other: Any?): Boolean { diff --git a/compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.kt.txt b/compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.kt.txt index 886ee3f0599..7e9005e86ce 100644 --- a/compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.kt.txt +++ b/compiler/testData/ir/irText/regressions/typeParametersInImplicitCast.kt.txt @@ -1,6 +1,6 @@ fun problematic(lss: List>): List { - return flatMap, T?>($receiver = lss, transform = local fun (it: List): List? { - return id(v = it) /*!! List */ + return flatMap, @FlexibleNullability T?>($receiver = lss, transform = local fun (it: List): @EnhancedNullability MutableList<@FlexibleNullability T?> { + return id<@FlexibleNullability T?>(v = it) /*!! List<@FlexibleNullability T?> */ } ) } diff --git a/compiler/testData/ir/irText/stubs/builtinMap.kt.txt b/compiler/testData/ir/irText/stubs/builtinMap.kt.txt index 24e6bbe40b2..00bcabf5d8c 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.kt.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.kt.txt @@ -1,7 +1,7 @@ fun Map.plus(pair: Pair): Map { return when { .isEmpty() -> mapOf(pair = pair) - true -> apply>($receiver = TODO("IrConstructorCall"), block = local fun LinkedHashMap.() { + true -> apply>($receiver = TODO("IrConstructorCall"), block = local fun LinkedHashMap<@FlexibleNullability K1?, @FlexibleNullability V1?>.() { .put(key = pair.(), value = pair.()) /*~> Unit */ } ) diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt index 415a84ae4a2..0f01555b3d5 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt.txt @@ -59,7 +59,7 @@ class Q { fun test1() { // COMPOSITE { - val tmp0_container: P? = notNullP() + val tmp0_container: @EnhancedNullability P = notNullP() val x: Int = tmp0_container /*!! P */.component1() val y: Int = tmp0_container /*!! P */.component2() // } @@ -68,34 +68,34 @@ fun test1() { fun test2() { // COMPOSITE { - val tmp0_container: @FlexibleNullability Q<@NotNull(...) String?, @NotNull(...) String?>? = notNullComponents() - val x: @NotNull(...) String? = tmp0_container /*!! Q<@NotNull(...) String?, @NotNull(...) String?> */.component1() - val y: @NotNull(...) String? = tmp0_container /*!! Q<@NotNull(...) String?, @NotNull(...) String?> */.component2() + val tmp0_container: @FlexibleNullability Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String>? = notNullComponents() + val x: @NotNull(...) @EnhancedNullability String = tmp0_container /*!! Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String> */.component1() + val y: @NotNull(...) @EnhancedNullability String = tmp0_container /*!! Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String> */.component2() // } use(x = x /*!! @NotNull(...) String */, y = y /*!! @NotNull(...) String */) } fun test2Desugared() { - val tmp: @FlexibleNullability Q<@NotNull(...) String?, @NotNull(...) String?>? = notNullComponents() - val x: @NotNull(...) String = tmp /*!! Q<@NotNull(...) String?, @NotNull(...) String?> */.component1() /*!! @NotNull(...) String */ - val y: @NotNull(...) String = tmp /*!! Q<@NotNull(...) String?, @NotNull(...) String?> */.component2() /*!! @NotNull(...) String */ + val tmp: @FlexibleNullability Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String>? = notNullComponents() + val x: @NotNull(...) String = tmp /*!! Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String> */.component1() /*!! @NotNull(...) String */ + val y: @NotNull(...) String = tmp /*!! Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String> */.component2() /*!! @NotNull(...) String */ use(x = x, y = y) } fun test3() { // COMPOSITE { - val tmp0_container: Q<@NotNull(...) String?, @NotNull(...) String?>? = notNullQAndComponents() - val x: @NotNull(...) String? = tmp0_container /*!! Q<@NotNull(...) String?, @NotNull(...) String?> */.component1() - val y: @NotNull(...) String? = tmp0_container /*!! Q<@NotNull(...) String?, @NotNull(...) String?> */.component2() + val tmp0_container: @EnhancedNullability Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String> = notNullQAndComponents() + val x: @NotNull(...) @EnhancedNullability String = tmp0_container /*!! Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String> */.component1() + val y: @NotNull(...) @EnhancedNullability String = tmp0_container /*!! Q<@NotNull(...) @EnhancedNullability String, @NotNull(...) @EnhancedNullability String> */.component2() // } use(x = x /*!! @NotNull(...) String */, y = y /*!! @NotNull(...) String */) } fun test4() { // COMPOSITE { - val tmp0_container: IndexedValue<@NotNull(...) P?> = first>($receiver = withIndex<@NotNull(...) P?>($receiver = listOfNotNull() /*!! List<@NotNull(...) P?> */)) + val tmp0_container: IndexedValue<@NotNull(...) @EnhancedNullability P> = first>($receiver = withIndex<@NotNull(...) @EnhancedNullability P>($receiver = listOfNotNull() /*!! List<@NotNull(...) @EnhancedNullability P> */)) val x: Int = tmp0_container.component1() - val y: @NotNull(...) P? = tmp0_container.component2() + val y: @NotNull(...) @EnhancedNullability P = tmp0_container.component2() // } use(x = x, y = y /*!! @NotNull(...) P */) } diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt index eb8bed36719..d8965c05dcc 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.kt.txt @@ -3,9 +3,9 @@ fun use(s: P) { fun testForInListUnused() { { //BLOCK - val tmp0_iterator: MutableIterator<@NotNull(...) P?> = listOfNotNull() /*!! List<@NotNull(...) P?> */ /*as MutableList<*> */.iterator() + val tmp0_iterator: MutableIterator<@NotNull(...) @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull(...) @EnhancedNullability P> */ /*as MutableList<*> */.iterator() while (tmp0_iterator.hasNext()) { //BLOCK - val x: @NotNull(...) P? = tmp0_iterator.next() + val x: @NotNull(...) @EnhancedNullability P = tmp0_iterator.next() { //BLOCK } } @@ -14,9 +14,9 @@ fun testForInListUnused() { fun testForInListDestructured() { { //BLOCK - val tmp0_iterator: MutableIterator<@NotNull(...) P?> = listOfNotNull() /*!! List<@NotNull(...) P?> */ /*as MutableList<*> */.iterator() + val tmp0_iterator: MutableIterator<@NotNull(...) @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull(...) @EnhancedNullability P> */ /*as MutableList<*> */.iterator() while (tmp0_iterator.hasNext()) { //BLOCK - val tmp1_loop_parameter: @NotNull(...) P? = tmp0_iterator.next() + val tmp1_loop_parameter: @NotNull(...) @EnhancedNullability P = tmp0_iterator.next() val x: Int = tmp1_loop_parameter /*!! @NotNull(...) P */.component1() val y: Int = tmp1_loop_parameter /*!! @NotNull(...) P */.component2() { //BLOCK @@ -26,7 +26,7 @@ fun testForInListDestructured() { } fun testDesugaredForInList() { - val iterator: MutableIterator<@NotNull(...) P?> = listOfNotNull() /*!! List<@NotNull(...) P?> */ /*as MutableList<*> */.iterator() + val iterator: MutableIterator<@NotNull(...) @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull(...) @EnhancedNullability P> */ /*as MutableList<*> */.iterator() while (iterator.hasNext()) { //BLOCK val x: @NotNull(...) P = iterator.next() /*!! @NotNull(...) P */ } @@ -34,9 +34,9 @@ fun testDesugaredForInList() { fun testForInArrayUnused(j: J) { { //BLOCK - val tmp0_iterator: Iterator = j.arrayOfNotNull() /*!! Array */ /*as Array */.iterator() + val tmp0_iterator: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array */ /*as Array<@EnhancedNullability P> */.iterator() while (tmp0_iterator.hasNext()) { //BLOCK - val x: P? = tmp0_iterator.next() + val x: @EnhancedNullability P = tmp0_iterator.next() { //BLOCK } } @@ -45,9 +45,9 @@ fun testForInArrayUnused(j: J) { fun testForInListUse() { { //BLOCK - val tmp0_iterator: MutableIterator<@NotNull(...) P?> = listOfNotNull() /*!! List<@NotNull(...) P?> */ /*as MutableList<*> */.iterator() + val tmp0_iterator: MutableIterator<@NotNull(...) @EnhancedNullability P> = listOfNotNull() /*!! List<@NotNull(...) @EnhancedNullability P> */ /*as MutableList<*> */.iterator() while (tmp0_iterator.hasNext()) { //BLOCK - val x: @NotNull(...) P? = tmp0_iterator.next() + val x: @NotNull(...) @EnhancedNullability P = tmp0_iterator.next() { //BLOCK use(s = x /*!! @NotNull(...) P */) use(s = x) @@ -58,9 +58,9 @@ fun testForInListUse() { fun testForInArrayUse(j: J) { { //BLOCK - val tmp0_iterator: Iterator = j.arrayOfNotNull() /*!! Array */ /*as Array */.iterator() + val tmp0_iterator: Iterator<@EnhancedNullability P> = j.arrayOfNotNull() /*!! Array */ /*as Array<@EnhancedNullability P> */.iterator() while (tmp0_iterator.hasNext()) { //BLOCK - val x: P? = tmp0_iterator.next() + val x: @EnhancedNullability P = tmp0_iterator.next() { //BLOCK use(s = x /*!! P */) use(s = x) @@ -114,7 +114,9 @@ data class P { } override fun hashCode(): Int { - return #x.hashCode().times(other = 31).plus(other = #y.hashCode()) + var result: Int = #x.hashCode() + result = result.times(other = 31).plus(other = #y.hashCode()) + return result } override operator fun equals(other: Any?): Boolean {