-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix NSNumber.objCType
crashes, make it returns same values with darwin platform version
#1025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
550afa7
075f832
ee48897
07d2595
7f49431
ea73230
68befb3
7e94118
7c2b737
2a5a611
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,3 +154,14 @@ open class NSValue : NSObject, NSCopying, NSSecureCoding, NSCoding { | |
} | ||
} | ||
|
||
extension NSValue : _Factory {} | ||
|
||
protocol _Factory { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just for maintainability; can we annotate this as internal? |
||
init(factory: () -> Self) | ||
} | ||
|
||
extension _Factory { | ||
init(factory: () -> Self) { | ||
self = factory() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm this is rather strange, if this works perhaps we should investigate using this pattern further There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, just prototyped a test for this... wow! this will solve a ton of issues with swift-corelibs-foundation! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is going to cause leaks, can we have a static allocation somewhere stashed with the type to cstrings?