Change resolution priority about implicit receivers and synthesized member-like descriptors.
Change resolution to consider extensions to implicit receiver before members of another implicit receiver. Make synthesized member-like extensions resolve right after the members. #KT-10510 Fixed #KT-10219 Fixed
This commit is contained in:
+2
-2
@@ -261,7 +261,7 @@ class KotlinIntroduceParameterDialog private constructor(
|
||||
var newArgumentValue = descriptor.newArgumentValue
|
||||
var newReplacer = descriptor.occurrenceReplacer
|
||||
|
||||
val startMarkAction = StartMarkAction.start(editor, myProject, commandName)
|
||||
val startMarkAction = StartMarkAction.start(editor, myProject, this@KotlinIntroduceParameterDialog.commandName)
|
||||
|
||||
lambdaExtractionDescriptor?.let { oldDescriptor ->
|
||||
val newDescriptor = KotlinExtractFunctionDialog.createNewDescriptor(
|
||||
@@ -318,7 +318,7 @@ class KotlinIntroduceParameterDialog private constructor(
|
||||
|
||||
override fun createUsageViewDescriptor(usages: Array<out UsageInfo>) = BaseUsageViewDescriptor()
|
||||
|
||||
override fun getCommandName(): String = commandName
|
||||
override fun getCommandName(): String = this@KotlinIntroduceParameterDialog.commandName
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class KotlinPushDownProcessor(
|
||||
addModifierWithSpace(KtTokens.OVERRIDE_KEYWORD)
|
||||
}
|
||||
} ?: addMemberToTarget(member, targetClass).apply {
|
||||
if (context.sourceClassDescriptor.kind == ClassKind.INTERFACE) {
|
||||
if (this@KotlinPushDownProcessor.context.sourceClassDescriptor.kind == ClassKind.INTERFACE) {
|
||||
if (targetClassDescriptor.kind != ClassKind.INTERFACE && memberDescriptor.modality == Modality.ABSTRACT) {
|
||||
addModifierWithSpace(KtTokens.ABSTRACT_KEYWORD)
|
||||
}
|
||||
|
||||
+2
-2
@@ -348,7 +348,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
|
||||
val sourcePosition = ContextUtil.getSourcePosition(this)
|
||||
val contextElement = createContextElement(this)
|
||||
|
||||
contextElement.putCopyableUserData(KotlinCodeFragmentFactory.DEBUG_FRAME_FOR_TESTS, evaluationContext.frameProxy)
|
||||
contextElement.putCopyableUserData(KotlinCodeFragmentFactory.DEBUG_FRAME_FOR_TESTS, this@AbstractKotlinEvaluateExpressionTest.evaluationContext.frameProxy)
|
||||
|
||||
try {
|
||||
|
||||
@@ -360,7 +360,7 @@ abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
|
||||
|
||||
if (evaluator == null) throw AssertionError("Cannot create an Evaluator for Evaluate Expression")
|
||||
|
||||
val value = evaluator.evaluate(evaluationContext)
|
||||
val value = evaluator.evaluate(this@AbstractKotlinEvaluateExpressionTest.evaluationContext)
|
||||
val actualResult = value.asValue().asString()
|
||||
|
||||
Assert.assertTrue("Evaluate expression returns wrong result for $text:\nexpected = $expectedResult\nactual = $actualResult\n", expectedResult == actualResult)
|
||||
|
||||
+3
-3
@@ -48,17 +48,17 @@ class BuiltInDecompilerTest : LightCodeInsightFixtureTestCase() {
|
||||
val stubTreeFromDecompiler = KotlinBuiltInStubBuilder().buildFileStub(FileContentImpl.createByFile(anyKotlinClass))!!
|
||||
myFixture.configureFromExistingVirtualFile(anyKotlinClass)
|
||||
val psiFile = myFixture.file
|
||||
KotlinTestUtils.assertEqualsToFile(File(testDataPath + "$testDataName.text"), psiFile.text)
|
||||
KotlinTestUtils.assertEqualsToFile(File(testDirPath + "$testDataName.text"), psiFile.text)
|
||||
|
||||
val stubTreeFromDecompiledText = KtFileStubBuilder().buildStubTree(psiFile)
|
||||
val expectedText = stubTreeFromDecompiledText.serializeToString()
|
||||
Assert.assertEquals(expectedText, stubTreeFromDecompiler.serializeToString())
|
||||
KotlinTestUtils.assertEqualsToFile(File(testDataPath + "$testDataName.stubs"), expectedText)
|
||||
KotlinTestUtils.assertEqualsToFile(File(testDirPath + "$testDataName.stubs"), expectedText)
|
||||
}
|
||||
|
||||
override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||
|
||||
companion object {
|
||||
private val testDataPath = PluginTestCaseBase.getTestDataPathBase() + "/decompiler/builtIns/"
|
||||
private val testDirPath = PluginTestCaseBase.getTestDataPathBase() + "/decompiler/builtIns/"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user