Created
May 11, 2015 21:00
-
-
Save cassdeckard/c18b1f24c7efb23735f2 to your computer and use it in GitHub Desktop.
Swift can't decide if [String] is Equatable?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import XCTest | |
| class GenericThing<T: Equatable> { | |
| func foo(t: T) { | |
| NSLog("foo \(t)") | |
| } | |
| } | |
| func genericFunc<T: Equatable>(left: T, right: T) { | |
| NSLog("\(left) == \(right) ?: \(left == right)") | |
| } | |
| class GenericThingTest { | |
| // WHY DOES THIS NOT COMPILE?!? | |
| //let testObject = GenericThing<[String]>() | |
| func testThatShouldClearlyPass() { | |
| // BUT THIS DOES??? | |
| genericFunc(["foo"], ["foo"]) | |
| XCTAssert(true) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment