[K1, K2] Use safe names when accessing to type parameters
^KT-57529 Fixed
This commit is contained in:
+6
@@ -12306,6 +12306,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("keywordsInsteadOfIdentifiers.kt")
|
||||||
|
public void testKeywordsInsteadOfIdentifiers() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/exceptions/keywordsInsteadOfIdentifiers.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt24158.kt")
|
@TestMetadata("kt24158.kt")
|
||||||
public void testKt24158() throws Exception {
|
public void testKt24158() throws Exception {
|
||||||
|
|||||||
+6
@@ -12306,6 +12306,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("keywordsInsteadOfIdentifiers.kt")
|
||||||
|
public void testKeywordsInsteadOfIdentifiers() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/exceptions/keywordsInsteadOfIdentifiers.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt24158.kt")
|
@TestMetadata("kt24158.kt")
|
||||||
public void testKt24158() throws Exception {
|
public void testKt24158() throws Exception {
|
||||||
|
|||||||
+6
@@ -12300,6 +12300,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("keywordsInsteadOfIdentifiers.kt")
|
||||||
|
public void testKeywordsInsteadOfIdentifiers() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/exceptions/keywordsInsteadOfIdentifiers.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt24158.kt")
|
@TestMetadata("kt24158.kt")
|
||||||
public void testKt24158() throws Exception {
|
public void testKt24158() throws Exception {
|
||||||
|
|||||||
+6
@@ -12306,6 +12306,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("keywordsInsteadOfIdentifiers.kt")
|
||||||
|
public void testKeywordsInsteadOfIdentifiers() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/exceptions/keywordsInsteadOfIdentifiers.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt24158.kt")
|
@TestMetadata("kt24158.kt")
|
||||||
public void testKt24158() throws Exception {
|
public void testKt24158() throws Exception {
|
||||||
|
|||||||
+2
-1
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.resolve.inference
|
|||||||
import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction
|
import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||||
import org.jetbrains.kotlin.fir.types.ConeTypeVariable
|
import org.jetbrains.kotlin.fir.types.ConeTypeVariable
|
||||||
|
import org.jetbrains.kotlin.name.SpecialNames
|
||||||
|
|
||||||
class ConeTypeVariableForPostponedAtom(name: String) : ConeTypeVariable(name)
|
class ConeTypeVariableForPostponedAtom(name: String) : ConeTypeVariable(name)
|
||||||
class ConeTypeVariableForLambdaParameterType(name: String, val index: Int) : ConeTypeVariable(name)
|
class ConeTypeVariableForLambdaParameterType(name: String, val index: Int) : ConeTypeVariable(name)
|
||||||
@@ -15,4 +16,4 @@ class ConeTypeVariableForLambdaReturnType(val argument: FirAnonymousFunction, na
|
|||||||
|
|
||||||
class ConeTypeParameterBasedTypeVariable(
|
class ConeTypeParameterBasedTypeVariable(
|
||||||
val typeParameterSymbol: FirTypeParameterSymbol
|
val typeParameterSymbol: FirTypeParameterSymbol
|
||||||
) : ConeTypeVariable(typeParameterSymbol.name.identifier, typeParameterSymbol.toLookupTag())
|
) : ConeTypeVariable(SpecialNames.safeIdentifier(typeParameterSymbol.name).identifier, typeParameterSymbol.toLookupTag())
|
||||||
|
|||||||
+2
-2
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.resolve.calls.inference.model
|
|||||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
import org.jetbrains.kotlin.name.SpecialNames
|
||||||
import org.jetbrains.kotlin.resolve.calls.model.PostponableKotlinCallArgument
|
import org.jetbrains.kotlin.resolve.calls.model.PostponableKotlinCallArgument
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.hasOnlyInputTypesAnnotation
|
import org.jetbrains.kotlin.resolve.descriptorUtil.hasOnlyInputTypesAnnotation
|
||||||
@@ -76,7 +76,7 @@ fun TypeConstructor.typeForTypeVariable(): SimpleType {
|
|||||||
|
|
||||||
class TypeVariableFromCallableDescriptor(
|
class TypeVariableFromCallableDescriptor(
|
||||||
val originalTypeParameter: TypeParameterDescriptor
|
val originalTypeParameter: TypeParameterDescriptor
|
||||||
) : NewTypeVariable(originalTypeParameter.builtIns, originalTypeParameter.name.identifier, originalTypeParameter) {
|
) : NewTypeVariable(originalTypeParameter.builtIns, SpecialNames.safeIdentifier(originalTypeParameter.name).identifier, originalTypeParameter) {
|
||||||
override fun hasOnlyInputTypesAnnotation(): Boolean = originalTypeParameter.hasOnlyInputTypesAnnotation()
|
override fun hasOnlyInputTypesAnnotation(): Boolean = originalTypeParameter.hasOnlyInputTypesAnnotation()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
|
// ISSUE: KT-57529
|
||||||
|
|
||||||
|
fun <<!SYNTAX!>break<!>> foo() {}
|
||||||
|
|
||||||
|
fun test(){
|
||||||
|
foo<String>()
|
||||||
|
}
|
||||||
Generated
+6
@@ -12306,6 +12306,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
runTest("compiler/testData/diagnostics/tests/exceptions/incorrectCallOnILT.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("keywordsInsteadOfIdentifiers.kt")
|
||||||
|
public void testKeywordsInsteadOfIdentifiers() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/exceptions/keywordsInsteadOfIdentifiers.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt24158.kt")
|
@TestMetadata("kt24158.kt")
|
||||||
public void testKt24158() throws Exception {
|
public void testKt24158() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user