fixup! [FIR] Assign the property source to accessors from delegates
diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt
index 1ddd7c1..dfe32a6 100644
--- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt
+++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirKeywordUtils.kt
@@ -22,6 +22,8 @@
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.psi.KtValVarKeywordOwner
import org.jetbrains.kotlin.util.getChildren
+import org.jetbrains.kotlin.utils.exceptions.errorWithAttachment
+import org.jetbrains.kotlin.utils.exceptions.withPsiEntry
// DO
// - use this to retrieve modifiers on the source and confirm a certain modifier indeed appears
@@ -96,7 +98,9 @@
// The check is required in the Analysis API mode as in this case property accessor
// has the containing property as a source
if (kind == KtFakeSourceElementKind.DelegatedPropertyAccessor && modifierListOwner is KtProperty) {
- error("Don't request modifiers on fake PSI of delegated property accessors, it's not the right PSI")
+ errorWithAttachment("Don't request modifiers on fake PSI of delegated property accessors, it's not the right PSI") {
+ withPsiEntry("property", modifierListOwner)
+ }
}
modifierListOwner?.modifierList?.let { FirModifierList.FirPsiModifierList(it) }