Commit b0d274dd authored by Him188's avatar Him188

Adjust param type: accept null in `UnsafeWeakRef<T>.getValue`

parent b5590996
...@@ -30,7 +30,7 @@ inline class UnsafeWeakRef<T>(private val weakRef: WeakRef<T>) { ...@@ -30,7 +30,7 @@ inline class UnsafeWeakRef<T>(private val weakRef: WeakRef<T>) {
* val bot: Bot by param.unsafeWeakRef() * val bot: Bot by param.unsafeWeakRef()
* ``` * ```
*/ */
operator fun <T> UnsafeWeakRef<T>.getValue(thisRef: Any?, property: KProperty<*>): T = get() operator fun <T> UnsafeWeakRef<T>.getValue(thisRef: Any?, property: KProperty<*>?): T = get()
/** /**
* Weak Reference. * Weak Reference.
...@@ -84,7 +84,7 @@ fun <T> T.unsafeWeakRef(): UnsafeWeakRef<T> = UnsafeWeakRef(this.weakRef()) ...@@ -84,7 +84,7 @@ fun <T> T.unsafeWeakRef(): UnsafeWeakRef<T> = UnsafeWeakRef(this.weakRef())
* val bot: Bot? by param.weakRef() * val bot: Bot? by param.weakRef()
* ``` * ```
*/ */
operator fun <T> WeakRef<T>.getValue(thisRef: Any?, property: KProperty<*>): T? = this.get() operator fun <T> WeakRef<T>.getValue(thisRef: Any?, property: KProperty<*>?): T? = this.get()
/** /**
* Call the block if the referent is absent * Call the block if the referent is absent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment