[ObjCExport] Document 'ObjCExportStubOrigin' factory special case

This commit is contained in:
Sebastian Sellmair
2023-12-13 12:02:39 +01:00
committed by Space Team
parent 7ef62d1779
commit 7944a3dc4b
@@ -21,7 +21,12 @@ fun ObjCExportStubOrigin(descriptor: DeclarationDescriptor?): ObjCExportStubOrig
return ObjCExportStubOrigin.Source(descriptor.name, descriptor.findKDocString(), (descriptor.source as? PsiSourceElement)?.psi)
}
return ObjCExportStubOrigin.Binary(descriptor.name, descriptor.extractSerializedKdocString())
/*
This case is somewhat unexpected/esoteric:
We expect the descriptor to either implement `DeserializedDescriptor` or `DeclarationDescriptorWithSource` (or both)
The returned 'Binary' is a defensive measure.
*/
return ObjCExportStubOrigin.Binary(descriptor.name, kdoc = null)
}