@@ -2979,19 +2979,19 @@ open class KotlinFileExtractor(
29792979 // as a workaround to silence warnings for kotlin < 2.3 about the elvis
29802980 // operator being redundant.
29812981 // For Kotlin >= 2.3, the cast is redundant, so we need to silence that warning
2982-
29832982 @Suppress(" USELESS_CAST" )
2984- val delegate = (s.delegate as IrVariable ? ) ? : run {
2985- logger.errorElement(" Local delegated property is missing delegate" , s)
2986- return
2987- }
2988- extractVariable(delegate, callable, blockId, 0 )
2989-
2983+ val delegate = s.delegate as IrVariable ?
29902984 val propId = tw.getFreshIdLabel<DbKt_property >()
2991- tw.writeKtProperties(propId, s.name.asString())
2992- tw.writeHasLocation(propId, locId)
2993- tw.writeKtPropertyDelegates(propId, useVariable(delegate))
29942985
2986+ if (delegate == null ) {
2987+ // This is not expected to happen, as the plugin hooks into the pipeline before IR lowering.
2988+ logger.errorElement(" Local delegated property is missing delegate" , s)
2989+ } else {
2990+ extractVariable(delegate, callable, blockId, 0 )
2991+ tw.writeKtProperties(propId, s.name.asString())
2992+ tw.writeHasLocation(propId, locId)
2993+ tw.writeKtPropertyDelegates(propId, useVariable(delegate))
2994+ }
29952995 // Getter:
29962996 extractStatement(s.getter, callable, blockId, 1 )
29972997 val getterLabel = getLocallyVisibleFunctionLabels(s.getter).function
0 commit comments