in src/main/kotlin/io/bazel/kotlin/plugin/jdeps/JdepsGenExtension.kt [171:204]
override fun check(
declaration: KtDeclaration,
descriptor: DeclarationDescriptor,
context: DeclarationCheckerContext
) {
when (descriptor) {
is ClassDescriptor -> {
descriptor.typeConstructor.supertypes.forEach {
collectTypeReferences(it)
}
}
is FunctionDescriptor -> {
descriptor.returnType?.let { collectTypeReferences(it) }
descriptor.valueParameters.forEach { valueParameter ->
collectTypeReferences(valueParameter.type)
}
descriptor.annotations.forEach { annotation ->
collectTypeReferences(annotation.type)
}
}
is PropertyDescriptor -> {
collectTypeReferences(descriptor.type)
descriptor.annotations.forEach { annotation ->
collectTypeReferences(annotation.type)
}
descriptor.backingField?.annotations?.forEach { annotation ->
collectTypeReferences(annotation.type)
}
}
is LocalVariableDescriptor -> {
collectTypeReferences(descriptor.type)
}
}
}