Files
swift-mirror/test/Interpreter/SDK/objc_protocol_lookup.swift
Dmitri Hrybenko 6058d291ca CMake: allow the SDK overlay to be built separately from the compiler
and the stdandard library

rdar://19703353

Swift SVN r25139
2015-02-10 21:57:03 +00:00

40 lines
640 B
Swift

// Check JIT mode
// RUN: %target-jit-run %s | FileCheck %s
// REQUIRES: swift_interpreter
// REQUIRES: objc_interop
import Foundation
@objc protocol Fungible: Runcible {
func funge()
}
@objc protocol Runcible {
func runce()
}
class C: Fungible {
@objc func runce() {}
@objc func funge() {}
}
class D {}
extension D: Fungible {
@objc func runce() {}
@objc func funge() {}
}
extension NSString: Fungible {
func runce() {}
func funge() {}
}
func check(x: AnyObject) {
println("\(x is Fungible) \(x is Runcible)")
}
check(NSString()) // CHECK: true true
check(C()) // CHECK: true true
check(D()) // CHECK: true true