I used Swift 5.1/Xcode 11.1 to reproduce this issue.
Consider the following code:
protocol P {
func f()
}
struct S: P {
func f() { }
}
func f(p: P) {
p.f()
}
class C {
@LazyConstant
var s: S = {
return S()
}()
func g() {
f(p: s)
}
}
Getting the following error: Expression type '()' is ambiguous without more context. To fix it replace f(p: s) with f(p: s as P). But as for me this is a bug.
I also created an issue at https://bugs.swift.org.
I used Swift 5.1/Xcode 11.1 to reproduce this issue. Consider the following code:
Getting the following error: Expression type '()' is ambiguous without more context. To fix it replace
f(p: s)
withf(p: s as P)
. But as for me this is a bug. I also created an issue at https://bugs.swift.org.