Files
swift-mirror/test/Interpreter/SDK/objc_witness_to_swift_protocol.swift
Arnold Schwaighofer 859fbc0162 More executable_test for the test directory
Swift SVN r29280
2015-06-03 23:28:51 +00:00

20 lines
352 B
Swift

// RUN: %target-run-simple-swift | FileCheck %s
// REQUIRES: executable_test
// REQUIRES: objc_interop
import Foundation
protocol Hashish {
var hash: Int { get }
}
extension NSObject: Hashish {}
func getHash<T: Hashish>(x: T) -> Int { return x.hash }
let u = NSURL(string: "http://www.example.com")!
// CHECK: true
print(u.hash == getHash(u))