Skip to content

Commit

Permalink
No BodyResolveMode.FULL in slicer
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinkip committed Apr 17, 2020
1 parent 91a793d commit 31a1b2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion idea/src/org/jetbrains/kotlin/idea/slicer/InflowSlicer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class InflowSlicer(
.forEach { it.processPropertyAssignments() }
}

val parameterDescriptor = parameter.resolveToParameterDescriptorIfAny(BodyResolveMode.FULL) ?: return
val parameterDescriptor = parameter.resolveToParameterDescriptorIfAny() ?: return

if (function is KtFunction) {
processCalls(function, includeOverriders, ArgumentSliceProducer(parameterDescriptor))
Expand Down
4 changes: 2 additions & 2 deletions idea/src/org/jetbrains/kotlin/idea/slicer/OutflowSlicer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class OutflowSlicer(
require(element == declaration.receiverTypeReference)

if (declaration.isExpectDeclaration()) {
declaration.resolveToDescriptorIfAny(BodyResolveMode.FULL)
declaration.resolveToDescriptorIfAny()
?.actualsForExpected()
?.forEach {
val actualDeclaration = (it as? DeclarationDescriptorWithSource)?.toPsi()
Expand Down Expand Up @@ -121,7 +121,7 @@ class OutflowSlicer(

if (callable != null) {
if (callable.isExpectDeclaration()) {
variable.resolveToDescriptorIfAny(BodyResolveMode.FULL)
variable.resolveToDescriptorIfAny()
?.actualsForExpected()
?.forEach {
(it as? DeclarationDescriptorWithSource)?.toPsi()?.passToProcessor()
Expand Down
5 changes: 2 additions & 3 deletions idea/src/org/jetbrains/kotlin/idea/slicer/Slicer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import org.jetbrains.kotlin.psi.psiUtil.parents
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
import org.jetbrains.kotlin.resolve.scopes.receivers.ImplicitReceiver
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
import org.jetbrains.kotlin.resolve.source.getPsi
Expand Down Expand Up @@ -121,7 +120,7 @@ abstract class Slicer(
.forEach { it.namedUnwrappedElement?.passToProcessor(mode) }

if (this is KtCallableDeclaration && isExpectDeclaration()) {
resolveToDescriptorIfAny(BodyResolveMode.FULL)
resolveToDescriptorIfAny()
?.actualsForExpected()
?.forEach {
(it as? DeclarationDescriptorWithSource)?.toPsi()?.passToProcessor(mode)
Expand Down Expand Up @@ -159,7 +158,7 @@ abstract class Slicer(
else -> return
}

val descriptor = callable.resolveToDescriptorIfAny(BodyResolveMode.FULL) as? CallableMemberDescriptor ?: return
val descriptor = callable.resolveToDescriptorIfAny() as? CallableMemberDescriptor ?: return
val superDescriptors = if (includeOverriders) {
descriptor.getDeepestSuperDeclarations()
} else {
Expand Down

0 comments on commit 31a1b2d

Please sign in to comment.