Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for IsConstType (0.49 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. src/go/types/decl.go

    	check.errpos = nil
    
    	// 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
    - 31K bytes
    - Viewed (0)
Back to top