Last active
May 9, 2017 13:17
-
-
Save jamiepinkham/4faf6fb94d878263ccbebefe4f40b8ac to your computer and use it in GitHub Desktop.
This file contains 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
struct IntBox: CustomDebugStringConvertible { | |
let int: Int | |
init(int: Int) { | |
self.int = int | |
} | |
var debugDescription: String { | |
return "Intbox: \(self.int)" | |
} | |
} | |
//shouldn't compile, but it does | |
func blah<R>(type: R.Type = R.self) -> Set<R> { | |
let z: Set<R> = Set<R>() | |
return z | |
} | |
blah(type: IntBox.self) | |
//error: in argument type 'IntBox.Type', 'IntBox' does not conform to expected type 'Hashable' blah(type: IntBox.self) | |
?? wat ?? how? very wonky. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment