[SR-7435] Compiler incorrectly disallows nonfinal classes from using default implementations that have same-type constraints on associated types of Self #49978
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
swift 4.1
type checker
Area → compiler: Semantic analysis
Additional Detail from JIRA
md5: 54e4c4d933929ccd0bf5a956a29ab02c
duplicates:
Issue Description:
This used to compile in 4.0, but gets rejected in 4.1 and master:
Although it would be correct to reject a protocol extension method with a same-type constraint on
Self
as a witness for a non-final class, it is not correct to do so for associated types ofSelf
, since those come from the conformance and ought to be invariant among all subclasses of a conforming type. I found this regression while attempting to build an embedded version of Realm with Xcode 9.3 as part of reproducing another crash.The text was updated successfully, but these errors were encountered: