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
[SR-14070] Property wrapper SIL assertion failure in development snapshot #56459
Comments
#35218 diff with the changed behavior. Those tests were error checking tests and weren't supposed to have sample code to be run involving the provided structs and property wrappers. With the compile error removed, they should be moved to |
Thanks for finding this! From the log you attached, it looks like DI is doing the right thing (re-writing the property wrapper assignment to initialization), but there's a verification failure on the property-wrapper setter, which is unused. I think this should only affect asserts compilers, but obviously it should be fixed either way. As for your second question, I think it's fine for "error" tests to contain cases that are okay. We probably don't gain anything by making that particular case executable. |
@swift-ci create |
I also can't seem to reproduce this if the property wrapper is not imported from another module, even with |
This reduced snippet reproduces the @propertyWrapper class ClassWrapper<T> {
var wrappedValue: T
init(wrappedValue initialValue: T) {
self.wrappedValue = initialValue
}
}
struct IntStructWithClassWrapper {
@ClassWrapper var wrapped: Int
init() {
wrapped = 42
}
} |
Perfect, thank you! Thankfully it still looks like the same issue. You're right that this should be moved to a separate file that doesn't contain errors. My mistake - I thought this was the same case as |
This should be fixed by #36253 |
Unfortunately it's not. With |
Okay, this one should fix it #36384 It wasn't the closure that was causing the assertion failure, but the `self` that the closure captured. |
Yes, I just tested with swift-DEVELOPMENT-SNAPSHOT-2021-03-20-a. It has been fixed. Thank you @eeckstein and @hborla! May I share another PropertyWrapper related bug which hasn't gotten a Radar URL yet? https://bugs.swift.org/browse/SR-14080 |
Resolved in swift-DEVELOPMENT-SNAPSHOT-2021-03-20-a. |
Attachment: Download
Environment
swift-DEVELOPMENT-SNAPSHOT-2021-01-17-a.xtoolchain
Target: x86_64-apple-darwin20.2.0
Additional Detail from JIRA
md5: 0a81634482216a0c94e91c76a6e6d6e4
Issue Description:
Consider the following code snippet:
With Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28), line
<1>
shows the errorWith Swift Development Snapshot 2021-01-17, no errors are shown, but if you start building you get an abort trap (see attachment "abort_trap.txt").
Related: if you add a generic parameter to
S
with Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28), line
<1>
shows the errorWith Swift Development Snapshot 2021-01-10 and later, no errors are shown, but if you start building you get an abort trap (see attachment "abort_trap_generic.txt").
The text was updated successfully, but these errors were encountered: