mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
22 lines
339 B
Swift
22 lines
339 B
Swift
// RUN: %target-swift-frontend -emit-silgen -enable-sil-ownership -verify %s
|
|
|
|
protocol AP {
|
|
associatedtype B: BP
|
|
var b: B { get }
|
|
}
|
|
protocol BP {}
|
|
|
|
func foo<A: AP>(x: A) -> A {
|
|
func bar<B: BP>(x: B) {
|
|
}
|
|
func bas<B: BP>(x: B) {
|
|
bar(x: x)
|
|
}
|
|
|
|
func bang() -> A { return x }
|
|
func bong(_: A) {}
|
|
|
|
let x = bang()
|
|
bong(x)
|
|
}
|