Deprecate lazy() that synchronizes on a given lock in non-JVM platforms
Because the overload has a meaningful implementation only in JVM. In other platforms the specified lock object is ignored. In K/N it throws UnsupportedOperationException.
This commit is contained in:
committed by
Space Team
parent
9864402cf8
commit
7d9ea28604
@@ -73,4 +73,6 @@ public expect fun <T> lazy(mode: LazyThreadSafetyMode, initializer: () -> T): La
|
||||
*
|
||||
* The [lock] parameter is ignored.
|
||||
*/
|
||||
@Deprecated("Synchronization on Any? object is supported only in Kotlin/JVM.", ReplaceWith("lazy(initializer)"))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.9")
|
||||
public expect fun <T> lazy(lock: Any?, initializer: () -> T): Lazy<T>
|
||||
|
||||
Reference in New Issue
Block a user