mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This is required to correctly use the mock SDK when the SDK overlay is built and tested separately. (Otherwise, the mock SDK might not get used, because the overlay SDK options would expand from the %-substitution, appear first on the command line, and shadow the mock SDK in the search path). Swift SVN r25185
32 lines
715 B
Swift
32 lines
715 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse %s -verify
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
// Note: this is in a separate file because -verify doesn't complain
|
|
// about diagnostics from other files.
|
|
import Foundation
|
|
import AppKit
|
|
|
|
// Okay to use an Objective-C-defined initializer to satisfy an
|
|
// initializer requirement in a protocol.
|
|
protocol URLInitializable {
|
|
init?(URL: String!)
|
|
}
|
|
|
|
extension NSDocument : URLInitializable { }
|
|
|
|
// Okay to satisfy an 'init' requirement with an 'init!'.
|
|
protocol IntInitializable {
|
|
init(int value: Int)
|
|
}
|
|
|
|
extension NSTableViewController : IntInitializable {
|
|
}
|
|
|
|
func testInitWithIntIUO() {
|
|
let tvc = NSTableViewController(int: 5)
|
|
if tvc == nil { }
|
|
}
|
|
|
|
|