We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: a3ae998d37de719ba38b7d2cee24e226
Issue Description:
This fails to compile,
struct Composite<Foo> { } protocol Chain { associatedtype Next: Chain associatedtype Foo = Composite<Next.Foo> // Associated type `Foo` references itself. }
But it shouldn't need to, since,
This is one work around (from @filip-sakel over the Swift's forum):
typealias CompositeWithoutFoo<Value> = Composite<Value.Foo> where Value: Chain protocol Chain { associatedtype Next: Chain associatedtype Foo = CompositeWithoutFoo<Next> // ✅ }
So either the checking is too restrictive, or the second code block should be illegal. Either way, this looks like a bug.
The text was updated successfully, but these errors were encountered:
Also, the following similar example will make the compiler get stuck in an infinite loop:
struct Composite<Foo> { } protocol Chain where Foo = Composite<Next.Foo> { associatedtype Next: Chain associatedtype Foo }
Sorry, something went wrong.
Fixed on main, adding a regression test.
No branches or pull requests
Additional Detail from JIRA
md5: a3ae998d37de719ba38b7d2cee24e226
Issue Description:
This fails to compile,
But it shouldn't need to, since,
This is one work around (from @filip-sakel over the Swift's forum):
So either the checking is too restrictive, or the second code block should be illegal. Either way, this looks like a bug.
The text was updated successfully, but these errors were encountered: