-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SE-0101] Migration support fix-it #3883
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
Conversation
@rintaro Thank you! |
|
||
_ = sizeofValue(x) // expected-error {{'sizeofValue' is unavailable: use MemoryLayout<T>.size instead.}} {{7-21=MemoryLayout<Cse0101<P>>.size}} {{none}} | ||
_ = alignofValue(x.val) // expected-error {{'alignofValue' is unavailable: use MemoryLayout<T>.alignment instead.}} {{7-26=MemoryLayout<P>.alignment}} {{none}} | ||
_ = strideofValue(x.val.getIt()) // expected-error {{'strideofValue' is unavailable: use MemoryLayout<T>.stride instead.}} {{7-35=MemoryLayout<P.Value>.stride}} {{none}} |
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.
strideofValue(x.val.getIt())
=> MemoryLayout<P.Value>.stride
Do we need preserve x.val.getIt()
?
i.e. (MemoryLayout<P.Value>.stride, x.val.getIt()).0
|
func _func<C: Collection>(c: C) where C.Index == Int {
_ = sizeof(C)
_ = sizeof(C.self)
_ = sizeof(C.Iterator.self)
_ = sizeof(c.dynamicType)
_ = sizeofValue(c)
_ = sizeofValue(c[0])
} result test0101.swift:2:14: warning: missing '.self' for reference to metatype of type 'C'
_ = sizeof(C)
^
.self
test0101.swift:2:7: error: 'sizeof' is unavailable: use MemoryLayout<T>.size instead.
_ = sizeof(C)
^~~~~~~ ~
MemoryLayout< >.size
test0101.swift:3:7: error: 'sizeof' is unavailable: use MemoryLayout<T>.size instead.
_ = sizeof(C.self)
^~~~~~~ ~~~~~~
MemoryLayout< >.size
test0101.swift:4:7: error: 'sizeof' is unavailable: use MemoryLayout<T>.size instead.
_ = sizeof(C.Iterator.self)
^~~~~~~ ~~~~~~
MemoryLayout< >.size
test0101.swift:5:7: error: 'sizeof' is unavailable: use MemoryLayout<T>.size instead.
_ = sizeof(c.dynamicType)
^~~~~~~~~~~~~~~~~~~~~
MemoryLayout<C>.size
test0101.swift:6:7: error: 'sizeofValue' is unavailable: use MemoryLayout<T>.size instead.
_ = sizeofValue(c)
^~~~~~~~~~~~~~
MemoryLayout<C>.size
test0101.swift:7:7: error: 'sizeofValue' is unavailable: use MemoryLayout<T>.size instead.
_ = sizeofValue(c[0])
^~~~~~~~~~~~~~~~~
MemoryLayout<C.Iterator.Element>.size |
@swift-ci Please test |
|
@rintaro Would you mind rebasing? Thanks! |
38887d9
to
fd4ddd6
Compare
@swift-ci Please smoke test |
@rudkx Would you mind reviewing the updated migration code? |
LGTM! |
What's in this pull request?
Split from #3854
Implement migration support fix-it for SE-0101
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
A smoke test on macOS does the following:
device standard libraries are not built.
version of these tests are not run.
A smoke test on Linux does the following:
tests are not run.
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.