We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Xcode 11.5 Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
md5: d83f8e6d38fac211d9618a0bcb3cb59f
Issue Description:
Consider this code:
@propertyWrapper struct P<Element> { init(wrappedValue: Element) { self.wrappedValue = wrappedValue } var wrappedValue: Element } class A<T> { init(_ t: T?) {} } struct Data { @P var i: Int? } func example() { let data = Data(i: 0) // This fails to compile A(data.i) }
The compiler should be able to type check `A`'s `T` as `Int`, but instead, there are 2 bugs here:
It can't infer it because of the ambiguity. It doesn't know if we mean `Int` or `P<Int?>`, but only the former should be valid anyway.
This produces a diagnostic which is incorrect, but also happens to be backwards:
Cannot convert value 'i' of type 'Int?' to expected type 'P<Int?>?', use wrapper instead
The text was updated successfully, but these errors were encountered:
Looks like this builds fine on Swift 5.3.
Sorry, something went wrong.
Great, thanks for confirming! Could you close this ticket?
NachoSoto
No branches or pull requests
Environment
Xcode 11.5
Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Additional Detail from JIRA
md5: d83f8e6d38fac211d9618a0bcb3cb59f
Issue Description:
Consider this code:
The compiler should be able to type check `A`'s `T` as `Int`, but instead, there are 2 bugs here:
It can't infer it because of the ambiguity. It doesn't know if we mean `Int` or `P<Int?>`, but only the former should be valid anyway.
This produces a diagnostic which is incorrect, but also happens to be backwards:
The text was updated successfully, but these errors were encountered: