Echo icon indicating copy to clipboard operation
Echo copied to clipboard

`ClassMetadata.descriptor`'s `ptr` is sometimes `nil`

Open NSExceptional opened this issue 3 years ago • 2 comments

Not sure what other information I need to provide, but just ask! I'm trying to inspect Swift classes in third party apps.

NSExceptional avatar Apr 27 '22 17:04 NSExceptional

In this instance it seems to be happening when you have a class defined in Swift, and then at runtime it is subclassed, and that subclass is what has the issue.

It's probably not an "issue" but it is something I'm not sure how to handle yet.

For context, this is something Firebase does to your app delegate

NSExceptional avatar Jul 02 '22 06:07 NSExceptional

I have updated my own fork with a fix; lmk if it's one you want to merge. I made SignedPointer have an implicitly unwrapped! pointer, and I made ClassMetadata.descriptor optional and forcefully unwrapped it in your tests. Might add a test for "artificial subclasses" if you do want this merged

NSExceptional avatar Jul 03 '22 21:07 NSExceptional