2
Taking some inspiration from Sebastian's answer, I came up with this solution:
func sameType<L,R>(left: L, right: R) -> Bool {
if let cast = left as? R {
return true
} else {
return false
}
}
This works even if nested within a function accepting generics:
func compare