Don't render pure error types in OverrideMemberChooserObject

#KT-34379 Fixed
This commit is contained in:
Vladimir Dolzhenko
2019-10-16 12:16:12 +02:00
parent 148a6bd54d
commit 30229da95a
8 changed files with 43 additions and 19 deletions
@@ -21,7 +21,7 @@ import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments
import org.jetbrains.kotlin.utils.checkWithAttachment
import kotlin.math.min
class ToFromOriginalFileMapper private constructor(
@@ -49,12 +49,11 @@ class ToFromOriginalFileMapper private constructor(
val syntheticText = syntheticFile.text
val originalSubSequence = originalText.subSequence(0, completionOffset)
val syntheticSubSequence = syntheticText.subSequence(0, completionOffset)
if (originalSubSequence != syntheticSubSequence) {
throw KotlinExceptionWithAttachments(
"original subText [len: ${originalSubSequence.length}]" +
" does not match synthetic subText [len: ${syntheticSubSequence.length}]"
)
.withAttachment("original subText", originalSubSequence.toString())
checkWithAttachment(originalSubSequence == syntheticSubSequence, {
"original subText [len: ${originalSubSequence.length}]" +
" does not match synthetic subText [len: ${syntheticSubSequence.length}]"
}) {
it.withAttachment("original subText", originalSubSequence.toString())
.withAttachment("synthetic subText", syntheticSubSequence.toString())
}