- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for IsConstType (0.59 sec)
-
src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go
if rhs, ok := want.(*types.Basic); ok && rhs.Info()&types.IsUntyped > 0 { if lhs, ok := got.Underlying().(*types.Basic); ok { return rhs.Info()&types.IsConstType == lhs.Info()&types.IsConstType } } return types.AssignableTo(want, got) } // MakeReadFile returns a simple implementation of the Pass.ReadFile function.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 11.7K bytes - Viewed (0) -
src/cmd/compile/internal/types2/predicates.go
func isString(t Type) bool { return isBasic(t, IsString) } func isIntegerOrFloat(t Type) bool { return isBasic(t, IsInteger|IsFloat) } func isConstType(t Type) bool { return isBasic(t, IsConstType) } // isBasic reports whether under(t) is a basic type with the specified info. // If t is a type parameter the result is false; i.e., // isBasic does not look inside a type parameter.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 17.5K bytes - Viewed (0) -
src/go/types/predicates.go
func isString(t Type) bool { return isBasic(t, IsString) } func isIntegerOrFloat(t Type) bool { return isBasic(t, IsInteger|IsFloat) } func isConstType(t Type) bool { return isBasic(t, IsConstType) } // isBasic reports whether under(t) is a basic type with the specified info. // If t is a type parameter the result is false; i.e., // isBasic does not look inside a type parameter.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:01:18 UTC 2024 - 17.6K bytes - Viewed (0) -
src/go/types/check.go
assert(typ != nil) if mode == invalid { return // omit } if mode == constant_ { assert(val != nil) // We check allBasic(typ, IsConstType) here as constant expressions may be // recorded as type parameters. assert(!isValid(typ) || allBasic(typ, IsConstType)) } if m := check.Types; m != nil { m[x] = TypeAndValue{mode, typ, val} } }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 23.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/check.go
assert(typ != nil) if mode == invalid { return // omit } if mode == constant_ { assert(val != nil) // We check allBasic(typ, IsConstType) here as constant expressions may be // recorded as type parameters. assert(!isValid(typ) || allBasic(typ, IsConstType)) } if m := check.Types; m != nil { m[x] = TypeAndValue{mode, typ, val} } if check.StoreTypesInSyntax { tv := TypeAndValue{mode, typ, val}
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 23.3K bytes - Viewed (0) -
src/go/internal/gcimporter/iimport.go
typ = r.typ() if r.p.exportVersion >= iexportVersionGo1_18 { // TODO: add support for using the kind _ = constant.Kind(r.int64()) } switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType { case types.IsBoolean: val = constant.MakeBool(r.bool()) case types.IsString: val = constant.MakeString(r.string()) case types.IsInteger: var x big.Int r.mpint(&x, b)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 19.2K bytes - Viewed (0) -
src/go/types/assignments.go
} // rhs must be a constant if x.mode != constant_ { check.errorf(x, InvalidConstInit, "%s is not constant", x) if lhs.typ == nil { lhs.typ = Typ[Invalid] } return } assert(isConstType(x.typ)) // If the lhs doesn't have a type yet, use the type of x. if lhs.typ == nil { lhs.typ = x.typ } check.assignment(x, lhs.typ, "constant declaration") if x.mode == invalid { return
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 16.4K bytes - Viewed (0) -
src/cmd/compile/internal/types2/assignments.go
} // rhs must be a constant if x.mode != constant_ { check.errorf(x, InvalidConstInit, "%s is not constant", x) if lhs.typ == nil { lhs.typ = Typ[Invalid] } return } assert(isConstType(x.typ)) // If the lhs doesn't have a type yet, use the type of x. if lhs.typ == nil { lhs.typ = x.typ } check.assignment(x, lhs.typ, "constant declaration") if x.mode == invalid { return
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Feb 23 21:21:43 UTC 2024 - 16.4K bytes - Viewed (0) -
api/go1.5.txt
pkg go/types, const IsBoolean = 1 pkg go/types, const IsBoolean BasicInfo pkg go/types, const IsComplex = 16 pkg go/types, const IsComplex BasicInfo pkg go/types, const IsConstType = 59 pkg go/types, const IsConstType BasicInfo pkg go/types, const IsFloat = 8 pkg go/types, const IsFloat BasicInfo pkg go/types, const IsInteger = 2 pkg go/types, const IsInteger BasicInfo pkg go/types, const IsNumeric = 26
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 30 21:14:09 UTC 2015 - 46.6K bytes - Viewed (0) -
src/cmd/compile/internal/types2/decl.go
check.errpos = nopos // provide valid constant value under all circumstances obj.val = constant.MakeUnknown() // determine type, if any if typ != nil { t := check.typ(typ) if !isConstType(t) { // don't report an error if the type is an invalid C (defined) type // (go.dev/issue/22090) if isValid(under(t)) { check.errorf(typ, InvalidConstType, "invalid constant type %s", t) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 29.6K bytes - Viewed (0)