Volatile forbidden for delegated properties (and checked for other use-site targets)
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
import kotlin.jvm.Volatile
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class My {
|
||||
<!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
|
||||
}
|
||||
Reference in New Issue
Block a user