- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for IsConstType (0.23 sec)
-
src/go/types/basic.go
const ( IsBoolean BasicInfo = 1 << iota IsInteger IsUnsigned IsFloat IsComplex IsString IsUntyped IsOrdered = IsInteger | IsFloat | IsString IsNumeric = IsInteger | IsFloat | IsComplex IsConstType = IsBoolean | IsNumeric | IsString ) // A Basic represents a basic type. type Basic struct { kind BasicKind info BasicInfo name string } // Kind returns the kind of basic type b.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 1.6K bytes - Viewed (0) -
src/cmd/compile/internal/types2/basic.go
const ( IsBoolean BasicInfo = 1 << iota IsInteger IsUnsigned IsFloat IsComplex IsString IsUntyped IsOrdered = IsInteger | IsFloat | IsString IsNumeric = IsInteger | IsFloat | IsComplex IsConstType = IsBoolean | IsNumeric | IsString ) // A Basic represents a basic type. type Basic struct { kind BasicKind info BasicInfo name string } // Kind returns the kind of basic type b.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Jul 01 22:17:50 UTC 2021 - 1.5K bytes - Viewed (0) -
src/go/types/conversions.go
} if val != nil { *val = constant.MakeString(string(codepoint)) } return true } return false } var ok bool var cause string switch { case constArg && isConstType(T): // constant conversion ok = constConvertibleTo(T, &x.val) // A conversion from an integer constant to an integer type // can only fail if there's overflow. Give a concise error. // (go.dev/issue/63563)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 18:51:00 UTC 2024 - 9.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/conversions.go
} if val != nil { *val = constant.MakeString(string(codepoint)) } return true } return false } var ok bool var cause string switch { case constArg && isConstType(T): // constant conversion ok = constConvertibleTo(T, &x.val) // A conversion from an integer constant to an integer type // can only fail if there's overflow. Give a concise error. // (go.dev/issue/63563)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 18:51:00 UTC 2024 - 9K bytes - Viewed (0) -
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)