ソースを参照

Add unstable api note

Him188 6 年 前
コミット
02d837db00

+ 2 - 0
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/WeakRef.kt

@@ -62,6 +62,8 @@ fun <T> WeakRef<T>.unsafe(): UnsafeWeakRef<T> = UnsafeWeakRef(this)
 /**
  * Provides a weak reference to [this].
  * The `getValue` for delegation throws an [IllegalStateException] if the referent is released by GC. Therefore it returns notnull value only
+ *
+ * **UNSTABLE API**: It is strongly suggested not to use this api
  */
 fun <T> T.unsafeWeakRef(): UnsafeWeakRef<T> = UnsafeWeakRef(this.weakRef())