mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] UsePropertyAccessSyntaxInspection: Get receiver types correctly for callable references on constructors
For example, Foo()::getFoo ^KTIJ-29118 Fixed Merge-request: IJ-MR-130070 Merged-by: Victoria Petrakovich <Victoria.Petrakovich@jetbrains.com> GitOrigin-RevId: 043bbaae95e30f22963db8dcf4c8c7ee06098aa6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0d7ec13856
commit
beeb0f1098
+4
-1
@@ -117,7 +117,10 @@ class UsePropertyAccessSyntaxInspection : LocalInspectionTool(), CleanupLocalIns
|
||||
|
||||
val problemHighlightType = getProblemHighlightType(symbolPsi)
|
||||
|
||||
val receiverType = callableReferenceExpression.getReceiverKtType()?.lowerBoundIfFlexible() ?: return
|
||||
val receiverType =
|
||||
callableReferenceExpression.resolveCall()
|
||||
?.successfulFunctionCallOrNull()?.partiallyAppliedSymbol?.dispatchReceiver?.type?.lowerBoundIfFlexible()
|
||||
?: callableReferenceExpression.getReceiverKtType()?.lowerBoundIfFlexible() ?: return
|
||||
|
||||
val syntheticProperty = getSyntheticProperty(propertyNames, receiverType) ?: return
|
||||
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
// LANGUAGE_VERSION: 2.1
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+ReferencesToSyntheticJavaProperties
|
||||
// FIX: Use property access syntax
|
||||
// IGNORE_K2
|
||||
// Delete the ignore directive after fixing KTIJ-29118
|
||||
|
||||
fun main() {
|
||||
suppressUnused(Foo()::<caret>getFoo)
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
// LANGUAGE_VERSION: 2.1
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+ReferencesToSyntheticJavaProperties
|
||||
// FIX: Use property access syntax
|
||||
// IGNORE_K2
|
||||
// Delete the ignore directive after fixing KTIJ-29118
|
||||
|
||||
fun main() {
|
||||
suppressUnused(Foo()::foo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user