[SR-2791] exc_bad_access if I try to inherit generic swift class from NSObject #45395
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
regression
run-time crash
Bug → crash: Swift code crashed during execution
swift 3.0
Attachment: Download
Additional Detail from JIRA
md5: 2dfbdebd7b3b6afb8df842a835d375a6
duplicates:
Issue Description:
Let me share my code sample.
I have protocol:
Base class.
If I remove NSObject inheritance everything is fine and works.
If not I can see exc_bad_access (image and output from XCode 8 Swift 3):
image: http://screencast.com/t/UG70X24fd
some output:
objc[43570]: CLASS: realizing class 'TtGC7Habitat11BaseSessionPS_26PDeviceProvisioningManager_' 0x120736030 0x1207360d0 #0
objc[43570]: CLASS: realizing class 'TtGC7Habitat11BaseSessionPS_26PDeviceProvisioningManager_' (meta) 0x1207360a8 0x120736118 #0
objc[43570]: CLASS: methodizing class 'TtGC7Habitat11BaseSessionPS_26PDeviceProvisioningManager_' (meta)
objc[43570]: CLASS: methodizing class 'TtGC7Habitat11BaseSessionPS_26PDeviceProvisioningManager_'
objc[43570]: CLASS: realizing class 'Habitat.DeviceProvisioningSession' 0x109841d50 0x1097f9c88 #0
objc[43570]: CLASS: realizing class 'Habitat.DeviceProvisioningSession' (meta) 0x109841d08 0x1097f9b98 #0
objc[43570]: CLASS: methodizing class 'Habitat.DeviceProvisioningSession' (meta)
objc[43570]: CLASS: methodizing class 'Habitat.DeviceProvisioningSession'
If it help, here is a part of DeviceProvisioningSession class:
Everything was ok with Swift 2.3, but I receiving exc_bad_access with Swift 3.
As I mentioned above, everything is fine in Swift 3, if I remove NSObject inheritance:
Base class.
So, it's seems like Swift 3 has an issue with NSObject inheritance and Swift Generics.
Best regards,
Vasili Silin.
The text was updated successfully, but these errors were encountered: