FE KT-47939 callable references to functional interface constructors
Allow callable references to Kotlin 'fun interface' constructors. Prohibit callable references to Java SAM interface constructors.
This commit is contained in:
committed by
TeamCityServer
parent
bfb6e73728
commit
1fd0dec5e7
+6
@@ -4333,4 +4333,10 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJvmErrors.JAVA_SAM_INTERFACE_CONSTRUCTOR_REFERENCE) { firDiagnostic ->
|
||||
JavaSamInterfaceConstructorReferenceImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -3016,4 +3016,8 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = SpreadOnSignaturePolymorphicCallWarning::class
|
||||
}
|
||||
|
||||
abstract class JavaSamInterfaceConstructorReference : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = JavaSamInterfaceConstructorReference::class
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -3646,3 +3646,8 @@ internal class SpreadOnSignaturePolymorphicCallWarningImpl(
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.SpreadOnSignaturePolymorphicCallWarning(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
internal class JavaSamInterfaceConstructorReferenceImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.JavaSamInterfaceConstructorReference(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user