Search Options

Results per page
Sort
Preferred Languages
Advance

Results 71 - 80 of 104 for type$val (0.19 sec)

  1. src/cmd/compile/internal/types2/check.go

    			panic("unreachable")
    		}
    		check.recordTypeAndValue(x, info.mode, info.typ, info.val)
    	}
    }
    
    func (check *Checker) recordTypeAndValue(x syntax.Expr, mode operandMode, typ Type, val constant.Value) {
    	assert(x != nil)
    	assert(typ != nil)
    	if mode == invalid {
    		return // omit
    	}
    	if mode == constant_ {
    		assert(val != nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.3K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ir/fmt.go

    		n := n.(*ParenExpr)
    		fmt.Fprintf(s, "(%v)", n.X)
    
    	case ONIL:
    		fmt.Fprint(s, "nil")
    
    	case OLITERAL:
    		if n.Sym() != nil {
    			fmt.Fprint(s, n.Sym())
    			return
    		}
    
    		typ := n.Type()
    		val := n.Val()
    
    		// Special case for rune constants.
    		if typ == types.RuneType || typ == types.UntypedRune {
    			if x, ok := constant.Uint64Val(val); ok && x <= utf8.MaxRune {
    				fmt.Fprintf(s, "%q", x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  3. src/encoding/json/encode_test.go

    func (*Ref) MarshalJSON() ([]byte, error) {
    	return []byte(`"ref"`), nil
    }
    
    func (r *Ref) UnmarshalJSON([]byte) error {
    	*r = 12
    	return nil
    }
    
    // Val has Marshaler methods with value receiver.
    type Val int
    
    func (Val) MarshalJSON() ([]byte, error) {
    	return []byte(`"val"`), nil
    }
    
    // RefText has Marshaler and Unmarshaler methods with pointer receiver.
    type RefText int
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 29.4K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/walk/switch.go

    					x.ITab = dt.ITab
    					val = x
    				} else if ir.IsNil(ncase.List[0]) {
    				} else {
    					base.Fatalf("unhandled type switch case %v", ncase.List[0])
    				}
    				val.SetType(caseVar.Type())
    				val.SetTypecheck(1)
    			}
    			l := []ir.Node{
    				ir.NewDecl(ncase.Pos(), ir.ODCL, caseVar),
    				ir.NewAssignStmt(ncase.Pos(), caseVar, val),
    			}
    			typecheck.Stmts(l)
    			sw.Compiled.Append(l...)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/util/jsonmergepatch/patch.go

    		switch {
    		case keepNull && val == nil:
    			filteredMap[key] = nil
    		case val != nil:
    			switch typedVal := val.(type) {
    			case map[string]interface{}:
    				// Explicitly-set empty maps are treated as values instead of empty patches
    				if len(typedVal) == 0 {
    					if !keepNull {
    						filteredMap[key] = typedVal
    					}
    					continue
    				}
    
    				var filteredSubMap map[string]interface{}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 28 08:48:22 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/cel/quantity.go

    }
    
    func (d Quantity) ConvertToType(typeVal ref.Type) ref.Val {
    	switch typeVal {
    	case quantityTypeValue:
    		return d
    	case types.TypeType:
    		return quantityTypeValue
    	default:
    		return types.NewErr("type conversion error from '%s' to '%s'", quantityTypeValue, typeVal)
    	}
    }
    
    func (d Quantity) Equal(other ref.Val) ref.Val {
    	otherDur, ok := other.(Quantity)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 04 11:23:54 UTC 2024
    - 2K bytes
    - Viewed (0)
  7. src/runtime/map_test.go

    	runtime.MapKeys(m, unsafe.Pointer(&keys))
    	for _, k := range keys {
    		if len(k.s) != 1 {
    			t.Errorf("len(k.s) == %d, want 1", len(k.s))
    		}
    	}
    }
    
    func TestMapValues(t *testing.T) {
    	type val struct {
    		s   string
    		pad [128]byte // sizeof(val) > abi.MapMaxElemBytes
    	}
    	m := map[int]val{1: {s: "a"}, 2: {s: "b"}}
    	vals := make([]val, 0, len(m))
    	runtime.MapValues(m, unsafe.Pointer(&vals))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 33.5K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/cel/ip.go

    }
    
    // ConvertToType implements ref.Val.ConvertToType.
    func (d IP) ConvertToType(typeVal ref.Type) ref.Val {
    	switch typeVal {
    	case IPType:
    		return d
    	case types.TypeType:
    		return IPType
    	case types.StringType:
    		return types.String(d.Addr.String())
    	}
    	return types.NewErr("type conversion error from '%s' to '%s'", IPType, typeVal)
    }
    
    // Equal implements ref.Val.Equal.
    func (d IP) Equal(other ref.Val) ref.Val {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Dec 15 11:02:33 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/cel/format.go

    	return nil, fmt.Errorf("type conversion error from 'Format' to '%v'", typeDesc)
    }
    
    func (d *Format) ConvertToType(typeVal ref.Type) ref.Val {
    	switch typeVal {
    	case FormatType:
    		return d
    	case types.TypeType:
    		return FormatType
    	default:
    		return types.NewErr("type conversion error from '%s' to '%s'", FormatType, typeVal)
    	}
    }
    
    func (d *Format) Equal(other ref.Val) ref.Val {
    	otherDur, ok := other.(*Format)
    	if !ok {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 23 17:22:44 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/cel/url.go

    }
    
    // ConvertToType implements ref.Val.ConvertToType.
    func (d URL) ConvertToType(typeVal ref.Type) ref.Val {
    	switch typeVal {
    	case typeValue:
    		return d
    	case types.TypeType:
    		return typeValue
    	}
    	return types.NewErr("type conversion error from '%s' to '%s'", typeValue, typeVal)
    }
    
    // Equal implements ref.Val.Equal.
    func (d URL) Equal(other ref.Val) ref.Val {
    	otherDur, ok := other.(URL)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 10 22:05:55 UTC 2022
    - 2K bytes
    - Viewed (0)
Back to top