Open stephencelis opened 2 years ago
@slavapestov You might have an idea of what's going on here...
I've occurred similar problems. For the example you mentioned above I've figured out a work around:
struct Build1<T: P>: P {
typealias A = T.A
let t: T
// This signature compiles
init<_A>(@B<_A> t: () -> T) where _A==T.A {
self.t = t()
}
}
Describe the bug
There are cases where result builder type inference fails when using protocols with generics, but succeeds when using an opaque result type.
Steps To Reproduce
Try to build the following code:
Expected behavior
I expect the line that fails to build. Right now it seems impossible to write
BuildN
as a conformance (Build1
) and instead we must write it as a function (Build2
).Environment (please fill out the following information)