Files
swift-mirror/test/ClangModules/objc_init_conformance.swift
Dmitri Hrybenko f43843f25c tests: use the new substitution for the mock SDK
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
2015-02-11 18:57:29 +00:00

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 { }
}