Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 34 for mapfndel (0.12 sec)

  1. src/go/types/index.go

    			return false
    		}
    		var key operand
    		check.expr(nil, &key, index)
    		check.assignment(&key, typ.key, "map index")
    		// ok to continue even if indexing failed - map element type is known
    		x.mode = mapindex
    		x.typ = typ.elem
    		x.expr = e.Orig
    		return false
    
    	case *Interface:
    		if !isTypeParam(x.typ) {
    			break
    		}
    		// TODO(gri) report detailed failure cause for better error messages
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  2. operator/pkg/tpath/struct.go

    	var structElems reflect.Value
    
    	switch kind {
    	case reflect.Map:
    		if path[0] == "" {
    			return nil, false, fmt.Errorf("getFromStructPath path %s, empty map key value", path)
    		}
    		mapVal := val.MapIndex(reflect.ValueOf(path[0]))
    		if !mapVal.IsValid() {
    			return nil, false, fmt.Errorf("getFromStructPath path %s, path does not exist", path)
    		}
    		return getFromStructPath(mapVal.Interface(), path[1:])
    	case reflect.Slice:
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 4.4K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/assignments.go

    	switch x.mode {
    	case invalid:
    		return Typ[Invalid]
    	case variable, mapindex:
    		// ok
    	default:
    		if sel, ok := x.expr.(*syntax.SelectorExpr); ok {
    			var op operand
    			check.expr(nil, &op, sel.X)
    			if op.mode == mapindex {
    				check.errorf(&x, UnaddressableFieldAssign, "cannot assign to struct field %s in map", ExprString(x.expr))
    				return Typ[Invalid]
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 23 21:21:43 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  4. src/go/types/assignments.go

    	switch x.mode {
    	case invalid:
    		return Typ[Invalid]
    	case variable, mapindex:
    		// ok
    	default:
    		if sel, ok := x.expr.(*ast.SelectorExpr); ok {
    			var op operand
    			check.expr(nil, &op, sel.X)
    			if op.mode == mapindex {
    				check.errorf(&x, UnaddressableFieldAssign, "cannot assign to struct field %s in map", ExprString(x.expr))
    				return Typ[Invalid]
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 18:48:38 UTC 2024
    - 16.4K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/index.go

    			return false
    		}
    		var key operand
    		check.expr(nil, &key, index)
    		check.assignment(&key, typ.key, "map index")
    		// ok to continue even if indexing failed - map element type is known
    		x.mode = mapindex
    		x.typ = typ.elem
    		x.expr = e
    		return false
    
    	case *Interface:
    		if !isTypeParam(x.typ) {
    			break
    		}
    		// TODO(gri) report detailed failure cause for better error messages
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 16:16:58 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  6. src/reflect/deepequal.go

    		if v1.Len() != v2.Len() {
    			return false
    		}
    		if v1.UnsafePointer() == v2.UnsafePointer() {
    			return true
    		}
    		iter := v1.MapRange()
    		for iter.Next() {
    			val1 := iter.Value()
    			val2 := v2.MapIndex(iter.Key())
    			if !val1.IsValid() || !val2.IsValid() || !deepValueEqual(val1, val2, visited) {
    				return false
    			}
    		}
    		return true
    	case Func:
    		if v1.IsNil() && v2.IsNil() {
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:30 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/example_test.go

    	case tv.IsType():
    		return "type"
    	case tv.IsBuiltin():
    		return "builtin"
    	case tv.IsNil():
    		return "nil"
    	case tv.Assignable():
    		if tv.Addressable() {
    			return "var"
    		}
    		return "mapindex"
    	case tv.IsValue():
    		return "value"
    	default:
    		return "unknown"
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 28 17:58:07 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  8. tests/fuzz/crd_roundtrip_fuzzer.go

    		}
    	case reflect.Map:
    		if e.IsNil() {
    			return fmt.Errorf("field is nil")
    		}
    		for _, k := range e.MapKeys() {
    			if e.IsNil() {
    				return fmt.Errorf("field is nil")
    			}
    			err := checkForNil(e.MapIndex(k))
    			if err != nil {
    				return err
    			}
    		}
    	case reflect.Ptr:
    		if e.IsNil() {
    			return fmt.Errorf("field is nil")
    		}
    
    		err := checkForNil(e.Elem())
    		if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Mar 01 01:34:15 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  9. src/go/ast/print.go

    	case reflect.Map:
    		p.printf("%s (len = %d) {", x.Type(), x.Len())
    		if x.Len() > 0 {
    			p.indent++
    			p.printf("\n")
    			for _, key := range x.MapKeys() {
    				p.print(key)
    				p.printf(": ")
    				p.print(x.MapIndex(key))
    				p.printf("\n")
    			}
    			p.indent--
    		}
    		p.printf("}")
    
    	case reflect.Pointer:
    		p.printf("*")
    		// type-checked ASTs may contain cycles - use ptrmap
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/runtime/converter.go

    	}
    
    	if sv.IsNil() {
    		dv.Set(reflect.Zero(dt))
    		return nil
    	}
    	dv.Set(reflect.MakeMap(dt))
    	for _, key := range sv.MapKeys() {
    		value := reflect.New(dt.Elem()).Elem()
    		if val := unwrapInterface(sv.MapIndex(key)); val.IsValid() {
    			if err := fromUnstructured(val, value, ctx); err != nil {
    				return err
    			}
    		} else {
    			value.Set(reflect.Zero(dt.Elem()))
    		}
    		if st.Key().AssignableTo(dt.Key()) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 11 16:02:13 UTC 2023
    - 24.9K bytes
    - Viewed (0)
Back to top