Bool returns v's underlying value. It panics if v's underlying type is not TypeBool.
()
| 118 | // Bool returns v's underlying value. It panics if v's underlying type is not |
| 119 | // TypeBool. |
| 120 | func (v Value) Bool() bool { |
| 121 | if v.Type().ID() != IDBool { |
| 122 | panic(fmt.Sprintf("super.Value.Bool called on %T", v.Type())) |
| 123 | } |
| 124 | if x, ok := v.native(); ok { |
| 125 | return x != 0 |
| 126 | } |
| 127 | return DecodeBool(v.bytes()) |
| 128 | } |
| 129 | |
| 130 | // Bytes returns v's BSUP representation. |
| 131 | func (v Value) Bytes() scode.Bytes { |