-
Notifications
You must be signed in to change notification settings - Fork 85
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
Instantiating an NSMutableAttributedString while importing SwiftyAttributes causes build error on Xcode 10 #29
Comments
NSMutableAttributedString
while importing SwiftyAttributes causes build error on Xcode 10
Thanks for pointing this out @ketzusaka. That's pretty strange that it only happens on |
Yeah, I’ll open one once I get to the office :) Thanks! |
…0's Swift compiler When instantiating an `NSMutableAttributedString` in a target that imports SwiftyAttributes on Xcode 10 the compiler was getting confused on which initializer to use. The convenience initializer added to `NSAttributedString` seems to be throwing the compiler out of whack. This updates argument names to give a clearer distinction and resolves the issue. See issue eddiekaiger#29 for more details.
Fixed and released in v5.0.0 :) |
I did the test in my FrameWork. When I just add
But, when also add new func and parameter type is
I delete the |
@wigl I don't think this pertains to the issue above -- but what's the compilation error you're getting? I can't reproduce it on Xcode 10. |
When the above extension is in the main project, there is no problem. @eddiekaiger |
We've had this issue in our project preventing Xcode 10 compilation since the release. The error is:
The usage was pretty basic, something like so:
After digging into it I discovered this doesn't happen unless we're importing SwiftyAttributes. If you duplicate the
testInit_withStringAndAttributes
test method, but replace theNSAttributedString
s withNSMutableAttributedString
s you'll get the same error when running the tests.Attempting to use the convenience initializer on a
NSMutableAttributedString
results in the following error:Taking out the convenience initializer on
NSAttributedString
, or giving the attributes parameter a different name resolves the issue.It's likely that this is a bug with Swift. I'm not sure if you'd rather file a bug with them and see what happens, or resolve the issue within the library now. Changing the attributes parameter would be a breaking change and be cause for a major bump.
Let me know if you're going to take action on this at the library level if ya can, as it is preventing us from building on XC10 :)
Here's the diff w/ the fix and test that I experimented with:
The text was updated successfully, but these errors were encountered: