Improve support of custom equals in inline classes
- Ensure that typed equals parameter's type is a star projection of corresponding inline class - Make possible to declare typed equals that returns 'Nothing' - Forbid type parameters in typed equals operator declaration ^KT-54909 fixed ^KT-54910 fixed
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ import kotlin.math.abs
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class IC(val x: Double) {
|
||||
fun equals(other: IC): Boolean {
|
||||
operator fun equals(other: IC): Boolean {
|
||||
return abs(x - other.x) < 0.1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user