Files
swift-mirror/test/Interpreter/SDK/objc_witness_to_swift_protocol.swift
Graham Batty 83b4384fac Update test flags for linux failures and support.
Also removed the sdk 'feature' in favour of the more specific
objc_interop.

Swift SVN r24856
2015-01-30 21:31:48 +00:00

19 lines
325 B
Swift

// RUN: %target-run-simple-swift | FileCheck %s
// 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
println(u.hash == getHash(u))