import kotlin.collections.* @CompileTimeCalculation class A(val a: Int) { override fun equals(other: Any?): Boolean { return other is Int && other == a } } const val customEquals1 = A(1) == 1 const val customEquals2 = A(1) == 123 const val customEquals3 = 1 == A(1) const val customEquals4 = 123 == A(1) const val customEquals5 = null == A(1) const val customEquals6 = A(1) == null @CompileTimeCalculation class B(val b: Int) { override fun equals(other: Any?): Boolean { other as? B ?: return false return this.b == other.b } override fun toString(): String = "B($b)" } const val areEquals = listOf(B(1), B(2)) == listOf(B(1), B(2)) const val asString = listOf(B(1), B(2)).toString()