[FIR] Throw REDECLARATION for duplicated enum entries
This commit is contained in:
+2
-2
@@ -142,7 +142,7 @@ interface FirDeclarationPresenter {
|
|||||||
appendRepresentation(it.returnTypeRef)
|
appendRepresentation(it.returnTypeRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun represent(it: FirProperty) = buildString {
|
fun represent(it: FirVariable) = buildString {
|
||||||
append('[')
|
append('[')
|
||||||
it.receiverTypeRef?.let {
|
it.receiverTypeRef?.let {
|
||||||
appendRepresentation(it)
|
appendRepresentation(it)
|
||||||
@@ -241,7 +241,7 @@ open class FirDeclarationInspector(
|
|||||||
declaration is FirSimpleFunction -> collectFunction(presenter.represent(declaration), declaration)
|
declaration is FirSimpleFunction -> collectFunction(presenter.represent(declaration), declaration)
|
||||||
declaration is FirRegularClass -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
declaration is FirRegularClass -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
||||||
declaration is FirTypeAlias -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
declaration is FirTypeAlias -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
||||||
declaration is FirProperty -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
declaration is FirVariable -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
//KT-2418 Front-end allows enum constants with same name
|
|
||||||
|
|
||||||
package kt2418
|
|
||||||
|
|
||||||
enum class A {
|
|
||||||
FOO,
|
|
||||||
FOO
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class B {
|
|
||||||
FOO;
|
|
||||||
|
|
||||||
fun FOO() {}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class C {
|
|
||||||
FOO;
|
|
||||||
|
|
||||||
val FOO = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class D {
|
|
||||||
FOO;
|
|
||||||
|
|
||||||
class FOO {}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
//KT-2418 Front-end allows enum constants with same name
|
//KT-2418 Front-end allows enum constants with same name
|
||||||
|
|
||||||
package kt2418
|
package kt2418
|
||||||
|
|||||||
Reference in New Issue
Block a user