// RUN: %target-typecheck-verify-swift
typealias Not = (A) -> Never
typealias And = (left: A, right: B)
indirect enum Or {
case inl(A)
case inr(B)
}
func deMorgan(_ ne: Not>) -> And, Not> {
// FIXME(diagnostics): The error message about initialization here is confusing
return And, Not>(
Not { a in ne(.left(a)) }, // expected-error {{type 'Not' (aka '(A) -> Never') has no member 'init'}}
// expected-error@-1 {{type 'Or' has no member 'left'}}
Not { a in ne(.right(a)) } // expected-error {{type 'Not' (aka '(B) -> Never') has no member 'init'}}
// expected-error@-1 {{type 'Or' has no member 'right'}}
)
}