Skip to content
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

Tests: Test conformance checker with witnesses in unavailable extensions #78872

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
10 changes: 9 additions & 1 deletion test/decl/protocol/req/unavailable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Bar : NonObjCProto { // expected-error {{type 'Bar' does not conform to pr

// Complain about unavailable witnesses (error in Swift 4, warning in Swift 3)
protocol P {
func foo(bar: Foo) // expected-note 2 {{requirement 'foo(bar:)' declared here}}
func foo(bar: Foo) // expected-note 3 {{requirement 'foo(bar:)' declared here}}
}

struct ConformsToP : P { // expected-error{{type 'ConformsToP' does not conform to protocol 'P'}}
Expand Down Expand Up @@ -64,6 +64,14 @@ extension ConformsToP5: P {
func foo(bar: Foo) { }
}

struct ConformsToP6: P {} // expected-error{{type 'ConformsToP6' does not conform to protocol 'P'}}
// expected-error@-1 {{unavailable instance method 'foo(bar:)' was used to satisfy a requirement of protocol 'P'}}

@available(*, unavailable)
extension ConformsToP6 {
func foo(bar: Foo) { } // expected-note {{'foo(bar:)' declared here}}
}

@available(*, unavailable)
enum UnavailableEnum {
struct ConformsToP6: P {
Expand Down