Skip to content

Commit

Permalink
Upgrade to Kotlin 2.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjeon committed Aug 27, 2024
1 parent 9016eae commit 8990524
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<dokka.version>0.10.1</dokka.version>
<kotlin.version>1.8.22</kotlin.version>
<kotlin.version>2.0.20</kotlin.version>
<spotless.version>6.25.0</spotless.version>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import java.util.Optional
import org.jetbrains.kotlin.com.intellij.psi.PsiComment
import org.jetbrains.kotlin.com.intellij.psi.PsiElement
import org.jetbrains.kotlin.com.intellij.psi.PsiWhiteSpace
import org.jetbrains.kotlin.com.intellij.psi.stubs.PsiFileStubImpl
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.KtAnnotatedExpression
Expand Down Expand Up @@ -1415,15 +1416,17 @@ class KotlinInputAstVisitor(
return 0
}

// Bug in Kotlin 1.9.10: KtProperyAccessor is the direct parent of the left and right paren
// Bug in Kotlin 1.9.10: KtPropertyAccessor is the direct parent of the left and right paren
// elements. Also parameterList is always null for getters. As a workaround, we create our own
// fake KtParameterList.
private fun getParameterListWithBugFixes(accessor: KtPropertyAccessor): KtParameterList? {
if (accessor.bodyExpression == null && accessor.bodyBlockExpression == null) return null

val stub = accessor.stub ?: PsiFileStubImpl(accessor.containingFile)

return object :
KtParameterList(
KotlinPlaceHolderStubImpl(accessor.stub, KtStubElementTypes.VALUE_PARAMETER_LIST)) {
KotlinPlaceHolderStubImpl(stub, KtStubElementTypes.VALUE_PARAMETER_LIST)) {
override fun getParameters(): List<KtParameter> {
return accessor.valueParameters
}
Expand Down

0 comments on commit 8990524

Please sign in to comment.