Quirrel4.41.0

types.Bool.weakref

Method on every bool
weakref(): any

Returns the bool itself.

Return value

this, unchanged - not a weakref value.

Notes

A bool is never reference counted, so there is nothing for sq_weakref to point a real weakref at; see types.Integer.weakref for the full mechanism.

Example

examples/types/bool/weakref.nut
let wr = true.weakref()
println("wr =", wr)
println("type(wr) =", type(wr)) // still "bool"
Output:
wr = true
type(wr) = bool

See also

weakrefReturns the integer itself.
weakrefReturns the float itself.
cloneReturns the bool itself.
boolclass index