You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to reflect an instance of a class that inherits from NSObject, it will crash while accessing a null pointer when trying to reflect NSObject.
Thanks for the input, @robertjpayne. I had a look at Runtime before I reported the bug. It also crashes when objects inherit from NSObject.
I can provide a fix for this issue. It's just that it might be a surprising change, because it would simply stop to look for inherited properties from the NSObject superclass. That's why I wanted to discuss the issue first.
I can also report the issue at the Runtime project. But the fix looked much more complicated over there 😄.
If you try to reflect an instance of a class that inherits from
NSObject
, it will crash while accessing a null pointer when trying to reflectNSObject
.The minimal example would be:
I have an example traceback in the attached screenshot. I tried with Swift 3.3 and Swift 4.1.
I see that there's already a workaround in the superclass reflection where we exclude the
SwiftObject
superclass:Reflection/Sources/Reflection/Metadata+Class.swift
Line 22 in 1414e12
Would it make sense to exclude the
NSObject
superclass in the same way? Or is reflecting on classes inherited from NSObject in general not supported?The text was updated successfully, but these errors were encountered: