Add "add type to callable reference LHS" quickfix to Code Cleanup
This commit is contained in:
@@ -91,7 +91,8 @@ public class KotlinCleanupInspection(): LocalInspectionTool(), CleanupLocalInspe
|
||||
Errors.DEPRECATED_SYMBOL_WITH_MESSAGE,
|
||||
Errors.NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION,
|
||||
Errors.BACKING_FIELD_SYNTAX_DEPRECATED,
|
||||
Errors.OPERATOR_MODIFIER_REQUIRED
|
||||
Errors.OPERATOR_MODIFIER_REQUIRED,
|
||||
Errors.CALLABLE_REFERENCE_TO_MEMBER_OR_EXTENSION_WITH_EMPTY_LHS
|
||||
)
|
||||
|
||||
private fun Diagnostic.isObsoleteLabel(): Boolean {
|
||||
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
|
||||
class AddTypeToLHSOfCallableReferenceFix(
|
||||
expression: JetCallableReferenceExpression
|
||||
) : JetIntentionAction<JetCallableReferenceExpression>(expression) {
|
||||
) : JetIntentionAction<JetCallableReferenceExpression>(expression), CleanupFix {
|
||||
override fun getFamilyName() = "Add type to left-hand side"
|
||||
override fun getText() = familyName
|
||||
|
||||
|
||||
@@ -54,3 +54,9 @@ fun foo() {
|
||||
B() + B()
|
||||
B() + B()
|
||||
}
|
||||
|
||||
class C {
|
||||
fun foo() {}
|
||||
|
||||
fun bar() = ::foo
|
||||
}
|
||||
|
||||
@@ -53,3 +53,9 @@ fun foo() {
|
||||
B() + B()
|
||||
B() + B()
|
||||
}
|
||||
|
||||
class C {
|
||||
fun foo() {}
|
||||
|
||||
fun bar() = C::foo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user