630c8e9df6
Without the fix, all libraries share the global scope for all project libraries. JDK_HOME was used implicitly for things such as providing Record support, but was not included as a test library/sdk. KT-59637
64 lines
1.7 KiB
Kotlin
Vendored
64 lines
1.7 KiB
Kotlin
Vendored
// FIR_IDENTICAL
|
|
// IGNORE_REVERSED_RESOLVE
|
|
// IGNORE_DIAGNOSTIC_API
|
|
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
|
// !LANGUAGE: +MultiPlatformProjects
|
|
|
|
// MODULE: common
|
|
// FILE: common.kt
|
|
// TARGET_PLATFORM: Common
|
|
import kotlin.concurrent.Volatile
|
|
import kotlin.properties.Delegates
|
|
|
|
class ConcurrentVolatile {
|
|
<!VOLATILE_ON_VALUE!>@Volatile<!> val x = 0
|
|
// ok
|
|
@Volatile var y = 1
|
|
|
|
<!VOLATILE_ON_DELEGATE!>@delegate:Volatile<!> var z: String by Delegates.observable("?") { prop, old, new -> old.hashCode() }
|
|
|
|
<!VOLATILE_ON_VALUE!>@field:Volatile<!> val w = 2
|
|
|
|
<!WRONG_ANNOTATION_TARGET!>@Volatile<!>
|
|
var noBacking: String
|
|
get() = ""
|
|
set(value) {}
|
|
}
|
|
|
|
// MODULE: jvm
|
|
// FILE: jvm.kt
|
|
// TARGET_PLATFORM: JVM
|
|
import kotlin.jvm.Volatile as JvmVolatile
|
|
import kotlin.concurrent.Volatile
|
|
import kotlin.properties.Delegates
|
|
|
|
class ConcurrentVolatileOnJvm {
|
|
<!VOLATILE_ON_VALUE!>@Volatile<!> val x = 0
|
|
// ok
|
|
@Volatile var y = 1
|
|
|
|
<!VOLATILE_ON_DELEGATE!>@delegate:Volatile<!> var z: String by Delegates.observable("?") { prop, old, new -> old.hashCode() }
|
|
|
|
<!VOLATILE_ON_VALUE!>@field:Volatile<!> val w = 2
|
|
|
|
<!WRONG_ANNOTATION_TARGET!>@Volatile<!>
|
|
var noBacking: String
|
|
get() = ""
|
|
set(value) {}
|
|
}
|
|
|
|
class JvmVolatile {
|
|
<!VOLATILE_ON_VALUE!>@JvmVolatile<!> val x = 0
|
|
// ok
|
|
@JvmVolatile var y = 1
|
|
|
|
<!VOLATILE_ON_DELEGATE!>@delegate:JvmVolatile<!> var z: String by Delegates.observable("?") { prop, old, new -> old.hashCode() }
|
|
|
|
<!VOLATILE_ON_VALUE!>@field:JvmVolatile<!> val w = 2
|
|
|
|
<!WRONG_ANNOTATION_TARGET!>@JvmVolatile<!>
|
|
var noBacking: String
|
|
get() = ""
|
|
set(value) {}
|
|
}
|