Skip to content

Instantly share code, notes, and snippets.

@jamiepinkham
Last active May 9, 2017 13:17
Show Gist options
  • Save jamiepinkham/4faf6fb94d878263ccbebefe4f40b8ac to your computer and use it in GitHub Desktop.
Save jamiepinkham/4faf6fb94d878263ccbebefe4f40b8ac to your computer and use it in GitHub Desktop.
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