Skip to content

Add a test for circular protocol inheritance through a typealias #23919

New issue

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

Merged
merged 1 commit into from
Apr 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/decl/protocol/conforms/circular_validation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ struct S : P { // expected-error {{type 'S' does not conform to protocol 'P'}}
static var x = 0 // expected-note {{candidate operates on a type, not an instance as required}}
var x = S.x // expected-note {{candidate references itself}}
}

// FIXME: Lousy diagnostics on this case.
protocol SR9224_Foo: SR9224_Foobar {} // expected-error 2 {{protocol 'SR9224_Foo' refines itself}}
protocol SR9224_Bar: SR9224_Foobar {} // expected-error {{protocol 'SR9224_Bar' refines itself}} expected-note {{protocol 'SR9224_Bar' declared here}}
typealias SR9224_Foobar = SR9224_Foo & SR9224_Bar