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:
+3
-3
@@ -6,7 +6,7 @@
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class A(val x: Int) {
|
||||
fun equals(other: A) = true
|
||||
operator fun equals(other: A) = true
|
||||
}
|
||||
|
||||
class C
|
||||
@@ -20,13 +20,13 @@ value class B2(val x: A?)
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class D1(val x: C) {
|
||||
fun equals(other: D1) = true
|
||||
operator fun equals(other: D1) = true
|
||||
}
|
||||
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class D2(val x: C?) {
|
||||
fun equals(other: D2) = true
|
||||
operator fun equals(other: D2) = true
|
||||
}
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
|
||||
Reference in New Issue
Block a user