mirror of
https://github.com/apple/swift.git
synced 2026-10-30 22:15:52 +01:00
15 lines
353 B
Swift
15 lines
353 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
protocol P {
|
|
associatedtype X // expected-note {{protocol requires nested type 'X'}}
|
|
}
|
|
|
|
struct S: P {} // expected-error {{type 'S' does not conform to protocol 'P'}}
|
|
// expected-note@-1 {{add stubs for conformance}}
|
|
|
|
func foo<T: P>(_ x: T) -> T.X {}
|
|
|
|
func bar(_ x: S) {
|
|
foo(x) // result of foo() is a hole
|
|
}
|