Files
kotlin-fork/compiler/testData/diagnostics/tests/valueClasses/identityComparisonWithValueClasses.fir.kt
T
Dmitriy Novozhilov b44dc55109 [TD] Mute some javac tests or update their testdata
There was a refactoring of AbstractDiagnosticsTest in 9052ef06 which
  contains bug that `setupEnvironment` for AbstractDiagnosticsTestUsingJavac
  was not called, so for last year tests `UsingJavac` had no difference
  with usual diagnostics tests which causes some contradictions in test data
2020-12-16 19:52:25 +03:00

30 lines
661 B
Kotlin
Vendored

// !SKIP_JAVAC
// !LANGUAGE: +InlineClasses
// !DIAGNOSTICS: -UNUSED_VARIABLE
package kotlin.jvm
annotation class JvmInline
@JvmInline
value class Foo(val x: Int)
@JvmInline
value class Bar(val y: String)
fun test(f1: Foo, f2: Foo, b1: Bar, fn1: Foo?, fn2: Foo?) {
val a1 = f1 === f2 || f1 !== f2
val a2 = f1 === f1
val a3 = f1 === b1 || f1 !== b1
val c1 = fn1 === fn2 || fn1 !== fn2
val c2 = f1 === fn1 || f1 !== fn1
val c3 = b1 === fn1 || b1 !== fn1
val any = Any()
val d1 = any === f1 || any !== f1
val d2 = f1 === any || f1 !== any
val d3 = any === fn1 || any !== fn1
val d4 = fn1 === any || fn1 !== any
}