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
|
||||
}
|
||||
@@ -2,8 +2,10 @@ package
|
||||
|
||||
public final class My {
|
||||
public constructor My()
|
||||
@field:kotlin.jvm.Volatile() public final val w: kotlin.Int = 2
|
||||
@kotlin.jvm.Volatile() public final val x: kotlin.Int = 0
|
||||
@kotlin.jvm.Volatile() public final var y: kotlin.Int
|
||||
@delegate:kotlin.jvm.Volatile() public final var z: kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
Reference in New Issue
Block a user