type go/constant.Value
108 uses
go/constant (current package)
value.go#L46: type Value interface {
value.go#L100: complexVal struct{ re, im Value }
value.go#L285: func vtoc(x Value) complexVal { return complexVal{x, int64Val(0)} }
value.go#L287: func makeInt(x *big.Int) Value {
value.go#L294: func makeRat(x *big.Rat) Value {
value.go#L307: func makeFloat(x *big.Float) Value {
value.go#L321: func makeComplex(re, im Value) Value {
value.go#L328: func makeFloatFromLiteral(lit string) Value {
value.go#L383: func MakeUnknown() Value { return unknownVal{} }
value.go#L386: func MakeBool(b bool) Value { return boolVal(b) }
value.go#L389: func MakeString(s string) Value {
value.go#L399: func MakeInt64(x int64) Value { return int64Val(x) }
value.go#L402: func MakeUint64(x uint64) Value {
value.go#L412: func MakeFloat64(x float64) Value {
value.go#L427: func MakeFromLiteral(lit string, tok token.Token, zero uint) Value {
value.go#L480: func BoolVal(x Value) bool {
value.go#L493: func StringVal(x Value) string {
value.go#L507: func Int64Val(x Value) (int64, bool) {
value.go#L523: func Uint64Val(x Value) (uint64, bool) {
value.go#L537: func Float32Val(x Value) (float32, bool) {
value.go#L562: func Float64Val(x Value) (float64, bool) {
value.go#L593: func Val(x Value) any {
value.go#L623: func Make(x any) Value {
value.go#L645: func BitLen(x Value) int {
value.go#L665: func Sign(x Value) int {
value.go#L702: func Bytes(x Value) []byte {
value.go#L734: func MakeFromBytes(bytes []byte) Value {
value.go#L766: func Num(x Value) Value {
value.go#L788: func Denom(x Value) Value {
value.go#L810: func MakeImag(x Value) Value {
value.go#L823: func Real(x Value) Value {
value.go#L836: func Imag(x Value) Value {
value.go#L854: func ToInt(x Value) Value {
value.go#L908: func ToFloat(x Value) Value {
value.go#L929: func ToComplex(x Value) Value {
value.go#L958: func UnaryOp(op token.Token, y Value, prec uint) Value {
value.go#L1020: func ord(x Value) int {
value.go#L1047: func match(x, y Value) (_, _ Value) {
value.go#L1059: func match0(x, y Value) (_, _ Value) {
value.go#L1103: func BinaryOp(x_ Value, op token.Token, y_ Value) Value {
value.go#L1228: var re, im Value
value.go#L1274: func add(x, y Value) Value { return BinaryOp(x, token.ADD, y) }
value.go#L1275: func sub(x, y Value) Value { return BinaryOp(x, token.SUB, y) }
value.go#L1276: func mul(x, y Value) Value { return BinaryOp(x, token.MUL, y) }
value.go#L1277: func quo(x, y Value) Value { return BinaryOp(x, token.QUO, y) }
value.go#L1282: func Shift(x Value, op token.Token, s uint) Value {
value.go#L1337: func Compare(x_ Value, op token.Token, y_ Value) bool {
go/types
api.go#L386: Value constant.Value
builtins.go#L151: var val constant.Value
check.go#L67: val constant.Value // constant value; or nil (if not a constant)
check.go#L76: iota constant.Value // value of iota in a constant declaration; nil otherwise
check.go#L244: func (check *Checker) rememberUntyped(e ast.Expr, lhs bool, mode operandMode, typ *Basic, val constant.Value) {
check.go#L572: func (check *Checker) recordTypeAndValueInSyntax(x ast.Expr, mode operandMode, typ Type, val constant.Value) {
const.go#L66: func representableConst(x constant.Value, check *Checker, typ *Basic, rounded *constant.Value) bool {
const.go#L209: func fitsFloat32(x constant.Value) bool {
const.go#L215: func roundFloat32(x constant.Value) constant.Value {
const.go#L224: func fitsFloat64(x constant.Value) bool {
const.go#L229: func roundFloat64(x constant.Value) constant.Value {
const.go#L254: func (check *Checker) representation(x *operand, typ *Basic) (constant.Value, Code) {
conversions.go#L23: constConvertibleTo := func(T Type, val *constant.Value) bool {
decl.go#L436: defer func(iota constant.Value, errpos positioner) {
expr.go#L344: func (check *Checker) updateExprVal(x ast.Expr, val constant.Value) {
expr.go#L357: func (check *Checker) implicitTypeAndValue(x *operand, target Type) (Type, constant.Value, Code) {
expr.go#L594: var xval constant.Value
expr.go#L614: var yval constant.Value
expr.go#L1172: func keyVal(x constant.Value) interface{} {
object.go#L263: val constant.Value
object.go#L268: func NewConst(pos token.Pos, pkg *Package, name string, typ Type, val constant.Value) *Const {
object.go#L273: func (obj *Const) Val() constant.Value { return obj.val }
operand.go#L63: val constant.Value
recording.go#L22: var val constant.Value
recording.go#L59: func (check *Checker) recordTypeAndValue(x ast.Expr, mode operandMode, typ Type, val constant.Value) {
stmt.go#L19: func (check *Checker) funcBody(decl *declInfo, name string, sig *Signature, body *ast.BlockStmt, iota constant.Value) {
stmt.go#L194: func goVal(val constant.Value) any {
universe.go#L155: val constant.Value
util.go#L56: func makeFromLiteral(lit string, kind token.Token) constant.Value {
golang.org/x/tools/internal/gcimporter
iexport.go#L1025: func (w *exportWriter) value(typ types.Type, v constant.Value) {
iexport.go#L1074: func constantToFloat(x constant.Value) *big.Float {
iexport.go#L1098: func valueToRat(x constant.Value) *big.Rat {
iimport.go#L674: func (r *importReader) value() (typ types.Type, val constant.Value) {
iimport.go#L779: func (r *importReader) mpfloat(typ *types.Basic) constant.Value {
golang.org/x/tools/internal/pkgbits
decoder.go#L433: func (r *Decoder) Value() constant.Value {
decoder.go#L443: func (r *Decoder) scalar() constant.Value {
encoder.go#L338: func (w *Encoder) Value(val constant.Value) {
encoder.go#L348: func (w *Encoder) scalar(val constant.Value) {