Compiler bug w.r.t. protocol inheritance and generics?

A protocol without associated types, static methods, or inits can still have semantic requirements that make self-conformance unsound.

Consider a hypothetical marker protocol, HasTwoValues—all conforming types have two possible values. Thus, Bool can conform to HasTwoValues. So can, for example, a hypothetical type ChessPlayer. If both types conform, then the existential type any HasTwoValues now has (at least) four values—therefore, it does not meet the semantic requirement of HasTwoValues.

2 Likes