Skip to content

Commit 9abb823

Browse files
authored
Resolve compiler warning (#1302)
1 parent ce4e084 commit 9abb823

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

src/main/kotlin/io/bazel/kotlin/plugin/jdeps/JdepsGenExtension.kt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -175,23 +175,21 @@ class JdepsGenExtension(
175175

176176
// Finally, collect types that depend on the type of the ResultingDescriptor and note that
177177
// these descriptors may be composed of multiple classes that we need to extract types from
178-
if (resultingDescriptor is DeclarationDescriptor) {
179-
val containingDeclaration = resultingDescriptor.containingDeclaration
180-
if (containingDeclaration is ClassDescriptor) {
181-
collectTypeReferences(containingDeclaration.defaultType)
182-
}
178+
val containingDeclaration = resultingDescriptor.containingDeclaration
179+
if (containingDeclaration is ClassDescriptor) {
180+
collectTypeReferences(containingDeclaration.defaultType)
181+
}
183182

184-
if (resultingDescriptor is PropertyDescriptor) {
185-
(
186-
resultingDescriptor.getter
187-
?.correspondingProperty as? SyntheticJavaPropertyDescriptor
188-
)?.let { syntheticJavaPropertyDescriptor ->
189-
collectTypeReferences(syntheticJavaPropertyDescriptor.type, isExplicit = false)
183+
if (resultingDescriptor is PropertyDescriptor) {
184+
(
185+
resultingDescriptor.getter
186+
?.correspondingProperty as? SyntheticJavaPropertyDescriptor
187+
)?.let { syntheticJavaPropertyDescriptor ->
188+
collectTypeReferences(syntheticJavaPropertyDescriptor.type, isExplicit = false)
190189

191-
val functionDescriptor = syntheticJavaPropertyDescriptor.getMethod
192-
functionDescriptor.dispatchReceiverParameter?.type?.let { dispatchReceiverType ->
193-
collectTypeReferences(dispatchReceiverType, isExplicit = false)
194-
}
190+
val functionDescriptor = syntheticJavaPropertyDescriptor.getMethod
191+
functionDescriptor.dispatchReceiverParameter?.type?.let { dispatchReceiverType ->
192+
collectTypeReferences(dispatchReceiverType, isExplicit = false)
195193
}
196194
}
197195
}

0 commit comments

Comments
 (0)