-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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-15111] “Type of expression is ambiguous” error when initializing a class #57437
Comments
@swift-ci create |
elidy (JIRA User) I see that you are assigned for this one, here is a hint - in |
@xedin Just an addition, this should be also the case for contextual type as well, for example |
Sure, if |
Hello @LucianoPAlmeida are you still working on this issue? First time contributor here, and got interested in this one. Any insights you could give me? |
Reduced set of test cases: struct S {
var str: String
}
func test(s: S?) {
let _: Int? = s?.str
func f(_: Int?) {}
f(s?.str)
} Environment update: Swift version 5.9-dev (LLVM 91080e65df791d6, Swift c1d5118) |
I actually forgot about this one 😆
I think is exactly what @xedin mentioned in previous comments. |
@xedin |
No, we need this diagnosed in |
Also, if I understand correctly, the last two |
Yes, the fixes are produced based on the failing constraint, |
… optional class instance (swiftlang#57437)
@pedromotita Are you still working on this? @Rajveer100 started a PR, so if not actively working on it can we change the assignee for this issue? |
… optional class instance (swiftlang#57437)
Already removed myself as the assignee. Keep on keeping on @Rajveer100 👍 😉 |
… optional class instance (swiftlang#57437)
… optional class instance (swiftlang#57437)
… optional class instance (swiftlang#57437)
… optional class instance (swiftlang#57437)
… optional class instance (swiftlang#57437)
… optional class instance (swiftlang#57437)
… optional class instance (swiftlang#57437)
… optional class instance (swiftlang#57437)
Environment
Xcode Version 13.0 beta 4 (13A5201i)
Additional Detail from JIRA
md5: 37c1160eb7b2424ea42b3ec849906fef
Issue Description:
When a class is initialized, passing an argument as a property of an optional class instance of incorrect type results in “Type of expression is ambiguous” error.
The text was updated successfully, but these errors were encountered: