[FIR] Reproduce KT-65584

The diagnostic target source element
type was changed to prevent crash due
to `checkPsiTypeConsistency()` in
`duplicateParameterNameSimplified.fir.kt`

^KT-65584
This commit is contained in:
Nikolay Lunyak
2024-02-07 15:55:59 +02:00
committed by Space Team
parent ef29879740
commit 8ec248131d
13 changed files with 174 additions and 4 deletions
@@ -333,7 +333,7 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
val reference: String
}
interface DuplicateParameterNameInFunctionType : KtFirDiagnostic<KtTypeReference> {
interface DuplicateParameterNameInFunctionType : KtFirDiagnostic<PsiElement> {
override val diagnosticClass get() = DuplicateParameterNameInFunctionType::class
}
@@ -386,7 +386,7 @@ internal class UnresolvedImportImpl(
internal class DuplicateParameterNameInFunctionTypeImpl(
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtTypeReference>(firDiagnostic, token), KtFirDiagnostic.DuplicateParameterNameInFunctionType
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.DuplicateParameterNameInFunctionType
internal class MissingDependencyClassImpl(
override val type: KtType,
@@ -357,6 +357,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/duplicateDirrectOverriddenCallables.kt");
}
@Test
@TestMetadata("duplicateParameterName.kt")
public void testDuplicateParameterName() throws Exception {
runTest("compiler/testData/diagnostics/tests/duplicateParameterName.kt");
}
@Test
@TestMetadata("duplicateParameterNameSimplified.kt")
public void testDuplicateParameterNameSimplified() throws Exception {
runTest("compiler/testData/diagnostics/tests/duplicateParameterNameSimplified.kt");
}
@Test
@TestMetadata("emptyLhsClassLiterals.kt")
public void testEmptyLhsClassLiterals() throws Exception {
@@ -357,6 +357,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/duplicateDirrectOverriddenCallables.kt");
}
@Test
@TestMetadata("duplicateParameterName.kt")
public void testDuplicateParameterName() throws Exception {
runTest("compiler/testData/diagnostics/tests/duplicateParameterName.kt");
}
@Test
@TestMetadata("duplicateParameterNameSimplified.kt")
public void testDuplicateParameterNameSimplified() throws Exception {
runTest("compiler/testData/diagnostics/tests/duplicateParameterNameSimplified.kt");
}
@Test
@TestMetadata("emptyLhsClassLiterals.kt")
public void testEmptyLhsClassLiterals() throws Exception {