diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt index 700a1b5c808..350dcf8c12e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt @@ -307,7 +307,7 @@ private fun suggestParameterType( private fun isMemberExtensionFunction(resolvedCall: ResolvedCall<*>, ref: KtSimpleNameExpression): Boolean { // TODO temporary hack because we couldn't correctly extract member extension function with two explicit receivers - if (ref.parent !is KtCallExpression || ref.parent.parent !is KtQualifiedExpression) return false + if (ref.parent !is KtCallExpression) return false val resultingDescriptor = resolvedCall.resultingDescriptor return resultingDescriptor is FunctionDescriptor && resolvedCall.extensionReceiver != ReceiverValue.NO_RECEIVER && resolvedCall.dispatchReceiver != ReceiverValue.NO_RECEIVER diff --git a/idea/testData/debugger/tinyApp/outs/extensionMemberFunction.out b/idea/testData/debugger/tinyApp/outs/extensionMemberFunction.out index 338a4975390..6fc55073d04 100644 --- a/idea/testData/debugger/tinyApp/outs/extensionMemberFunction.out +++ b/idea/testData/debugger/tinyApp/outs/extensionMemberFunction.out @@ -19,23 +19,35 @@ Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socke extensionMemberFunction.kt:13 Compile bytecode for extClass.testPublic() extensionMemberFunction.kt:19 +Compile bytecode for testPublic() extensionMemberFunction.kt:25 Compile bytecode for extClass.testPrivate() extensionMemberFunction.kt:31 +Compile bytecode for testPrivate() extensionMemberFunction.kt:41 +Compile bytecode for testPublic() extensionMemberFunction.kt:46 +Compile bytecode for this.testPublic() extensionMemberFunction.kt:51 +Compile bytecode for testPrivate() extensionMemberFunction.kt:56 +Compile bytecode for this.testPrivate() extensionMemberFunction.kt:70 Compile bytecode for extClass.testCompPublic() extensionMemberFunction.kt:76 +Compile bytecode for testCompPublic() extensionMemberFunction.kt:82 Compile bytecode for extClass.testCompPrivate() extensionMemberFunction.kt:88 +Compile bytecode for testCompPrivate() extensionMemberFunction.kt:98 +Compile bytecode for testCompPublic() extensionMemberFunction.kt:103 +Compile bytecode for this.testCompPublic() extensionMemberFunction.kt:108 +Compile bytecode for testCompPrivate() extensionMemberFunction.kt:113 +Compile bytecode for this.testCompPrivate() Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket' Process finished with exit code 0 diff --git a/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/extensionMemberFunction.kt b/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/extensionMemberFunction.kt index 5b8b022ac6d..ce6ba8fccd1 100644 --- a/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/extensionMemberFunction.kt +++ b/idea/testData/debugger/tinyApp/src/evaluate/multipleBreakpoints/extensionMemberFunction.kt @@ -14,7 +14,7 @@ class MemberClass { with(extClass) { // EXPRESSION: testPublic() - // RESULT: Following declarations are unavailable in debug scope: testPublic + // RESULT: 1: I //Breakpoint! testPublic() } @@ -26,7 +26,7 @@ class MemberClass { with(extClass) { // EXPRESSION: testPrivate() - // RESULT: Following declarations are unavailable in debug scope: testPrivate + // RESULT: 1: I //Breakpoint! testPrivate() } @@ -36,22 +36,22 @@ class MemberClass { fun ExtClass.testExtMember() { // EXPRESSION: testPublic() - // RESULT: Following declarations are unavailable in debug scope: testPublic + // RESULT: 1: I //Breakpoint! testPublic() // EXPRESSION: this.testPublic() - // RESULT: A receiver of type extensionMemberFunction.ExtClass is required + // RESULT: 1: I //Breakpoint! this.testPublic() // EXPRESSION: testPrivate() - // RESULT: Following declarations are unavailable in debug scope: testPrivate + // RESULT: 1: I //Breakpoint! testPrivate() // EXPRESSION: this.testPrivate() - // RESULT: A receiver of type extensionMemberFunction.ExtClass is required + // RESULT: 1: I //Breakpoint! this.testPrivate() } @@ -71,7 +71,7 @@ class MemberClass { with(extClass) { // EXPRESSION: testCompPublic() - // RESULT: Following declarations are unavailable in debug scope: testCompPublic + // RESULT: 1: I //Breakpoint! testCompPublic() } @@ -83,7 +83,7 @@ class MemberClass { with(extClass) { // EXPRESSION: testCompPrivate() - // RESULT: Following declarations are unavailable in debug scope: testCompPrivate + // RESULT: 1: I //Breakpoint! testCompPrivate() } @@ -93,22 +93,22 @@ class MemberClass { fun ExtClass.testExtCompanion() { // EXPRESSION: testCompPublic() - // RESULT: Following declarations are unavailable in debug scope: testCompPublic + // RESULT: 1: I //Breakpoint! testCompPublic() // EXPRESSION: this.testCompPublic() - // RESULT: A receiver of type extensionMemberFunction.ExtClass is required + // RESULT: 1: I //Breakpoint! this.testCompPublic() // EXPRESSION: testCompPrivate() - // RESULT: Following declarations are unavailable in debug scope: testCompPrivate + // RESULT: 1: I //Breakpoint! testCompPrivate() // EXPRESSION: this.testCompPrivate() - // RESULT: A receiver of type extensionMemberFunction.ExtClass is required + // RESULT: 1: I //Breakpoint! this.testCompPrivate() }