diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt index d632e689781..adc7c95ccc7 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt @@ -45,7 +45,7 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty override fun SimpleTypeMarker.fastCorrespondingSupertypes(constructor: TypeConstructorMarker): List? { require(this is ConeKotlinType) return if (this is ConeIntegerLiteralType) { - supertypes + supertypes.filter { isEqualTypeConstructors(constructor, it.typeConstructor()) } } else { session.correspondingSupertypesCache.getCorrespondingSupertypes(this, constructor) } diff --git a/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfTypesWithErrorSupertypes.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfTypesWithErrorSupertypes.fir.kt index 2a170857f27..6e6071bae27 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfTypesWithErrorSupertypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfTypesWithErrorSupertypes.fir.kt @@ -8,7 +8,7 @@ interface Foo { fun select(vararg args: S): S = TODO() class Bar : Foo { - val v = select( + val v = select( getSum(), 42 ) diff --git a/compiler/testData/diagnostics/tests/library/Collections.fir.kt b/compiler/testData/diagnostics/tests/library/Collections.fir.kt index 23fb5dd6f26..688e3b4aa77 100644 --- a/compiler/testData/diagnostics/tests/library/Collections.fir.kt +++ b/compiler/testData/diagnostics/tests/library/Collections.fir.kt @@ -4,7 +4,7 @@ package collections fun testCollection(c: Collection, t: T) { c.size c.isEmpty() - c.contains(1) + c.contains(1) val iterator: Iterator = c.iterator() c.containsAll(c) @@ -20,7 +20,7 @@ fun testCollection(c: Collection, t: T) { fun testMutableCollection(c: MutableCollection, t: T) { c.size c.isEmpty() - c.contains(1) + c.contains(1) val iterator: Iterator = c.iterator() c.containsAll(c) @@ -62,7 +62,7 @@ fun testMutableList(l: MutableList, t: T) { fun testSet(s: Set, t: T) { s.size s.isEmpty() - s.contains(1) + s.contains(1) val iterator: Iterator = s.iterator() s.containsAll(s) @@ -78,7 +78,7 @@ fun testSet(s: Set, t: T) { fun testMutableSet(s: MutableSet, t: T) { s.size s.isEmpty() - s.contains(1) + s.contains(1) val iterator: Iterator = s.iterator() s.containsAll(s) @@ -108,4 +108,4 @@ fun testMutableMap(m: MutableMap) { val mutableSet1: MutableSet> = m.entries } -fun array(vararg t: T): Array {} \ No newline at end of file +fun array(vararg t: T): Array {} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.fir.kt index b5b053046f7..7d1d24a3487 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.fir.kt @@ -2,7 +2,7 @@ // FILE: KotlinFile.kt fun foo(javaClass: JavaClass): Int { val inner = javaClass.createInner() - return inner.doSomething(1, "") { } + return inner.doSomething(1, "") { } } // FILE: JavaClass.java diff --git a/compiler/testData/ir/irText/expressions/kt30796.fir.txt b/compiler/testData/ir/irText/expressions/kt30796.fir.txt index bd65fde6b86..0b70ed16ffd 100644 --- a/compiler/testData/ir/irText/expressions/kt30796.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt30796.fir.txt @@ -11,10 +11,10 @@ FILE fqName: fileName:/kt30796.kt VALUE_PARAMETER name:value2 index:1 type:T of .test BLOCK_BODY VAR name:x1 type:kotlin.Any [val] - BLOCK type=T of .test origin=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:T of .test [val] GET_VAR 'value: T of .test declared in .test' type=T of .test origin=null - WHEN type=T of .test origin=ELVIS + WHEN type=kotlin.Any origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_0: T of .test [val] declared in .test' type=T of .test origin=null @@ -24,18 +24,18 @@ FILE fqName: fileName:/kt30796.kt if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val tmp_0: T of .test [val] declared in .test' type=T of .test origin=null VAR name:x2 type:kotlin.Any [val] - BLOCK type=T of .test origin=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:T of .test [val] GET_VAR 'value: T of .test declared in .test' type=T of .test origin=null - WHEN type=T of .test origin=ELVIS + WHEN type=kotlin.Any origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_1: T of .test [val] declared in .test' type=T of .test origin=null arg1: CONST Null type=kotlin.Nothing? value=null - then: BLOCK type=T of .test origin=ELVIS + then: BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:T of .test [val] GET_VAR 'value2: T of .test declared in .test' type=T of .test origin=null - WHEN type=T of .test origin=ELVIS + WHEN type=kotlin.Any origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_2: T of .test [val] declared in .test' type=T of .test origin=null @@ -48,7 +48,7 @@ FILE fqName: fileName:/kt30796.kt if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val tmp_1: T of .test [val] declared in .test' type=T of .test origin=null VAR name:x3 type:kotlin.Any [val] - BLOCK type=T of .test origin=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:T of .test [val] BLOCK type=T of .test origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:T of .test [val] @@ -62,7 +62,7 @@ FILE fqName: fileName:/kt30796.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val tmp_4: T of .test [val] declared in .test' type=T of .test origin=null - WHEN type=T of .test origin=ELVIS + WHEN type=kotlin.Any origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_3: T of .test [val] declared in .test' type=T of .test origin=null @@ -72,7 +72,7 @@ FILE fqName: fileName:/kt30796.kt if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val tmp_3: T of .test [val] declared in .test' type=T of .test origin=null VAR name:x4 type:kotlin.Any [val] - BLOCK type=T of .test origin=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:T of .test [val] BLOCK type=T of .test origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:T of .test [val] @@ -86,7 +86,7 @@ FILE fqName: fileName:/kt30796.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val tmp_6: T of .test [val] declared in .test' type=T of .test origin=null - WHEN type=T of .test origin=ELVIS + WHEN type=kotlin.Any origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_5: T of .test [val] declared in .test' type=T of .test origin=null @@ -111,7 +111,7 @@ FILE fqName: fileName:/kt30796.kt then: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int GET_VAR 'val tmp_7: kotlin.Int? [val] declared in .test' type=kotlin.Int? origin=null VAR name:x6 type:kotlin.Any [val] - BLOCK type=T of .test origin=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:T of .test [val] BLOCK type=T of .test origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:T of .test [val] @@ -126,7 +126,7 @@ FILE fqName: fileName:/kt30796.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val tmp_9: T of .test [val] declared in .test' type=T of .test origin=null - WHEN type=T of .test origin=ELVIS + WHEN type=kotlin.Any origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_8: T of .test [val] declared in .test' type=T of .test origin=null @@ -136,7 +136,7 @@ FILE fqName: fileName:/kt30796.kt if: CONST Boolean type=kotlin.Boolean value=true then: GET_VAR 'val tmp_8: T of .test [val] declared in .test' type=T of .test origin=null VAR name:x7 type:kotlin.Any [val] - BLOCK type=T of .test origin=ELVIS + BLOCK type=kotlin.Any origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:T of .test? [val] BLOCK type=T of .test? origin=ELVIS VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:T of .test? [val] @@ -152,7 +152,7 @@ FILE fqName: fileName:/kt30796.kt if: CONST Boolean type=kotlin.Boolean value=true then: TYPE_OP type=T of .test origin=IMPLICIT_CAST typeOperand=T of .test GET_VAR 'val tmp_11: T of .test? [val] declared in .test' type=T of .test? origin=null - WHEN type=T of .test origin=ELVIS + WHEN type=kotlin.Any origin=ELVIS BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp_10: T of .test? [val] declared in .test' type=T of .test? origin=null diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt index c101704aad4..1c3fc096dca 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt @@ -17,7 +17,7 @@ open class Case1 { x x.toByte() x.length - x.get(0) + x.get(0) x.size x.isEmpty() x[null] diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt index c101704aad4..1c3fc096dca 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt @@ -17,7 +17,7 @@ open class Case1 { x x.toByte() x.length - x.get(0) + x.get(0) x.size x.isEmpty() x[null] diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt index c101704aad4..1c3fc096dca 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt @@ -17,7 +17,7 @@ open class Case1 { x x.toByte() x.length - x.get(0) + x.get(0) x.size x.isEmpty() x[null]