[FIR] Forbid erroneous ===-checks
It was decided to forbid such comparisons, as we know how `===` works. Also, added some more test cases, just for comparison. Reusing the proper `canHaveSubtypes()` from `TypeUtils` prevents a breaking change in: - `comparingTripleWithPair.kt` - `comparisonOfGenericInterfaceWithGenericClass.kt` But it does lead to warnings (instead of errors) in `incompatibleEnumEntryClasses.kt`, which is an unrelated mistake that will be fixed in the next commit. The refactoring in `canHaveSubtypes()` is purely cosmetic - otherwise reading these conditions is hard (and they don't fit my screen vertically). ^KT-62646 ^KT-65541 ^KT-57779
This commit is contained in:
committed by
Space Team
parent
6bf987e772
commit
226d4df277
@@ -1,8 +1,11 @@
|
||||
package
|
||||
|
||||
public fun jj(/*0*/ a: JavaEnumA, /*1*/ b: JavaEnumB): kotlin.Boolean
|
||||
public fun jj2(/*0*/ a: JavaEnumA, /*1*/ b: JavaEnumB): kotlin.Boolean
|
||||
public fun jk(/*0*/ a: JavaEnumA, /*1*/ b: KotlinEnumB): kotlin.Boolean
|
||||
public fun jk2(/*0*/ a: JavaEnumA, /*1*/ b: KotlinEnumB): kotlin.Boolean
|
||||
public fun kk(/*0*/ a: KotlinEnumA, /*1*/ b: KotlinEnumB): kotlin.Boolean
|
||||
public fun kk2(/*0*/ a: KotlinEnumA, /*1*/ b: KotlinEnumB): kotlin.Boolean
|
||||
|
||||
public final enum class JavaEnumA : kotlin.Enum<JavaEnumA!> {
|
||||
public constructor JavaEnumA()
|
||||
|
||||
Reference in New Issue
Block a user