It would provide a compilation error as  emp1 == emp2 cannot be resolved by compiler. It depends if the structs/classes are adapted to the Hashable protocol. The primitive data type like Int, String by default implement the Hashable protocol, show they do not show any error if we compare instances of such data types. The corrected code would be: struct Employee: Hashable {
var name:String
var  id:Int
init(name:String, id:Int) {
self.name = name
self.id = id
}
var  hashValue: Int { return self.id}
}
The printed result would be true. This is one of the most frequently asked Swift interview questions for freshers and experienced in recent times.