-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[Foundation] handle ambiguity in swift 4 mode for Data.init with byte sequences #18443
Conversation
@swift-ci please smoke test |
@swift-ci please smoke benchmark |
Can you add a test? |
the only part that isn't tested is the swift4 mode map(Data.init) case. is there a way I can get a test compiled as swift4 mode instead of 4.2 mode? |
Build comment file:Optimized (O)Regression (6)
Improvement (6)
No Changes (433)
Hardware Overview
|
@swift-ci please smoke test |
AFAIK you can pass both |
3741bf5
to
c43059d
Compare
@swift-ci please smoke test |
var DataTests = TestSuite("TestDataSwift4") | ||
|
||
DataTests.test("functional map init usage") { | ||
let res1 = [[UInt8(0), UInt8(1), UInt8(2)]].map(Data.init) // previously this could be done without being ambiguous (however in swift 4.2 an overload was added that makes it ambiguous as a function ref) |
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 what I had in mind, thanks!
c43059d
to
e51fbd6
Compare
@swift-ci please smoke test |
e51fbd6
to
024a4b0
Compare
@swift-ci please smoke test |
024a4b0
to
40ea0d6
Compare
@swift-ci please smoke test |
40ea0d6
to
b65faee
Compare
@swift-ci please smoke test and merge |
@swift-ci smoke test and merge |
Inadvertently we broke projects using the functional passing for map and Data.init in swift 4 mode. Imperative initialization however was not affected. To resolve this we need to annotate that the specialization of the bytes sequence initializer needs to be introduced in swift 4.2 which should leave 4.0 mode still source compatible.