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:
vladislav.grechko
2022-11-11 16:44:03 +01:00
parent 02484baf07
commit 36b8ba8df3
38 changed files with 369 additions and 136 deletions
@@ -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