Generate equals/hashCode(): Use class literals when possible
#KT-18683 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// PLATFORM: JavaScript
|
||||
class A {
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
|
||||
<caret>override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (other == null || other::class.js != this::class.js) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return this::class.js.hashCode()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user