Open typesanitizer opened 4 years ago
cc @AnthonyLatsis – not sure if this is related to your upcoming work in https://github.com/apple/swift/pull/31092
@swift-ci create
(I don't have an actual use case for this, I was trying to test how far I could stretch the recursion, since basic examples seemed to work fine.)
Yeah, this is a separate issue. We recurse into SuperclassTypeRequest
while looking up C: P
for B<C>
. We need a way to ask for the unspecialized conformance to avoid the circularity.
Reduced case:
protocol P {}
class B<T: P> : P {}
class C: B<C> {}
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, TypeChecker | |Assignee | None | |Priority | Medium | md5: d62c6c6302980168d341cac388f1d0b1Issue Description:
Consider the code below:
It's not super obvious to me whether this code should compile or not, because this probably requires a complex notion of consistency-checking. But the diagnostic
error: 'C' inherits from itself
is inaccurate,C
is not inheriting from itself.