From 6ba4e376967c19a67b016ff4daed1ae8003e4464 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Mon, 17 Apr 2023 09:57:27 +0200 Subject: [PATCH] [psi] don't load ast for compiled code deserialized parameters do not contain real default values anyway --- .../psi/src/org/jetbrains/kotlin/psi/KtParameter.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtParameter.java b/compiler/psi/src/org/jetbrains/kotlin/psi/KtParameter.java index d4f0e236693..ef91e5460bb 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtParameter.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtParameter.java @@ -85,7 +85,16 @@ public class KtParameter extends KtNamedDeclarationStub imp @Nullable public KtExpression getDefaultValue() { KotlinParameterStub stub = getStub(); - if (stub != null && !stub.hasDefaultValue()) return null; + if (stub != null) { + if (!stub.hasDefaultValue()) { + return null; + } + + if (getContainingKtFile().isCompiled()) { + //don't load ast + return null; + } + } PsiElement equalsToken = getEqualsToken(); return equalsToken != null ? PsiTreeUtil.getNextSiblingOfType(equalsToken, KtExpression.class) : null;