mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
25 lines
503 B
Swift
25 lines
503 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-ir -o - -primary-file %s -swift-version 4
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
class SwiftLaundryService : NSLaundry {
|
|
var g: (Garment & Coat)? = nil
|
|
|
|
func wash(_ g: Garment & Coat) {
|
|
self.g = g
|
|
}
|
|
|
|
func bleach(_ g: Garment & Coat & Cotton) {}
|
|
|
|
func dry() -> Garment & Coat {
|
|
return g!
|
|
}
|
|
}
|
|
|
|
func doTheLaundry(_ service: NSLaundry, clothing: Garment & Coat) {
|
|
service.wash(clothing)
|
|
_ = service.dry()
|
|
}
|