mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-06 17:10:48 +08:00
Adjust param type: accept null in UnsafeWeakRef<T>.getValue
This commit is contained in:
parent
b55909969c
commit
b0d274dd1a
@ -30,7 +30,7 @@ inline class UnsafeWeakRef<T>(private val weakRef: WeakRef<T>) {
|
||||
* 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.
|
||||
@ -84,7 +84,7 @@ fun <T> T.unsafeWeakRef(): UnsafeWeakRef<T> = UnsafeWeakRef(this.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
|
||||
|
Loading…
Reference in New Issue
Block a user