[FIR] Support of REDECLARATION for local val/var, ^KT-54405 Fixed

This commit is contained in:
Ivan Kochurkin
2022-12-01 15:08:34 +01:00
committed by Space Team
parent 879deb90fc
commit e49bb1fe37
30 changed files with 201 additions and 85 deletions
@@ -0,0 +1,28 @@
// ISSUE: KT-54405
class A {
operator fun component1() = 1
operator fun component2() = ""
}
fun test(b: Boolean) {
val <!REDECLARATION!>y<!> = 1
val <!REDECLARATION!>y<!> = 2
val <!REDECLARATION!>`_`<!> = 3
val <!REDECLARATION!>`_`<!> = 4
{
var <!REDECLARATION!>a<!> = 10
var <!REDECLARATION!>a<!> = 11
}
if (b) {
val z = 3
val <!REDECLARATION!>x<!> = 5
val <!REDECLARATION!>x<!> = 6
} else {
val z = 4
}
}
fun test2() {
val (`_`, _) = A()
}
@@ -0,0 +1,28 @@
// ISSUE: KT-54405
class A {
operator fun component1() = 1
operator fun component2() = ""
}
fun test(b: Boolean) {
val <!REDECLARATION!>y<!> = 1
val <!NAME_SHADOWING, REDECLARATION!>y<!> = 2
val <!REDECLARATION!>`_`<!> = 3
val <!NAME_SHADOWING, REDECLARATION!>`_`<!> = 4
{
var <!REDECLARATION!>a<!> = 10
var <!NAME_SHADOWING, REDECLARATION!>a<!> = 11
}
if (b) {
val z = 3
val <!REDECLARATION!>x<!> = 5
val <!NAME_SHADOWING, REDECLARATION!>x<!> = 6
} else {
val z = 4
}
}
fun test2() {
val (`_`, _) = A()
}
@@ -0,0 +1,14 @@
package
public fun test(/*0*/ b: kotlin.Boolean): kotlin.Unit
public fun test2(): kotlin.Unit
public final class A {
public constructor A()
public final operator fun component1(): kotlin.Int
public final operator fun component2(): kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}