Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 523 for Map (0.05 sec)

  1. src/internal/types/testdata/fixedbugs/issue51158.go

    package p
    
    // Type checking the following code should not cause an infinite recursion.
    func f[M map[K]int, K comparable](m M) {
            f(m)
    }
    
    // Equivalent code using mutual recursion.
    func f1[M map[K]int, K comparable](m M) {
            f2(m)
    }
    func f2[M map[K]int, K comparable](m M) {
            f1(m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 02:58:32 UTC 2022
    - 463 bytes
    - Viewed (0)
  2. test/typeparam/builtins.go

    }
    
    func f4[T C5[X], X any](ch T) {
    	close(ch)
    }
    
    // delete
    
    type M0 interface{ int }
    type M1 interface{ map[string]int }
    type M2 interface {
    	map[string]int | map[string]float64
    }
    type M3 interface{ map[string]int | map[rune]int }
    type M4[K comparable, V any] interface{ map[K]V | map[rune]V }
    
    func g1[T M1](m T) {
    	delete(m, "foo")
    }
    
    func g2[T M2](m T) {
    	delete(m, "foo")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 09:04:48 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  3. src/internal/dag/alg.go

    // license that can be found in the LICENSE file.
    
    package dag
    
    // Transpose reverses all edges in g.
    func (g *Graph) Transpose() {
    	old := g.edges
    
    	g.edges = make(map[string]map[string]bool)
    	for _, n := range g.Nodes {
    		g.edges[n] = make(map[string]bool)
    	}
    
    	for from, tos := range old {
    		for to := range tos {
    			g.edges[to][from] = true
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 04 15:31:44 UTC 2022
    - 1.3K bytes
    - Viewed (0)
  4. src/expvar/expvar.go

    	v.f.Store(math.Float64bits(value))
    }
    
    // Map is a string-to-Var map variable that satisfies the [Var] interface.
    type Map struct {
    	m      sync.Map // map[string]Var
    	keysMu sync.RWMutex
    	keys   []string // sorted
    }
    
    // KeyValue represents a single entry in a [Map].
    type KeyValue struct {
    	Key   string
    	Value Var
    }
    
    func (v *Map) String() string {
    	return string(v.appendJSON(nil))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 21:32:11 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  5. test/fixedbugs/issue62203.go

    	// Remove that 49th entry. m is still growing to 8 buckets,
    	// but a clone of m will only have 4 buckets because it
    	// only needs to fit 48 entries.
    	delete(m, "foo")
    
    	// Clone an 8-bucket map to a 4-bucket map.
    	_ = maps.Clone(m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 25 16:10:03 UTC 2023
    - 688 bytes
    - Viewed (0)
  6. src/go/ast/print_test.go

    	{nil, "0  nil"},
    	{true, "0  true"},
    	{42, "0  42"},
    	{3.14, "0  3.14"},
    	{1 + 2.718i, "0  (1+2.718i)"},
    	{"foobar", "0  \"foobar\""},
    
    	// maps
    	{map[Expr]string{}, `0  map[ast.Expr]string (len = 0) {}`},
    	{map[string]int{"a": 1},
    		`0  map[string]int (len = 1) {
    		1  .  "a": 1
    		2  }`},
    
    	// pointers
    	{new(int), "0  *0"},
    
    	// arrays
    	{[0]int{}, `0  [0]int {}`},
    	{[3]int{1, 2, 3},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  7. src/internal/types/testdata/fixedbugs/issue47127.go

    // license that can be found in the LICENSE file.
    
    // Embedding of stand-alone type parameters is not permitted.
    
    package p
    
    type (
            _[P any] interface{ *P | []P | chan P | map[string]P }
            _[P any] interface{ P /* ERROR "term cannot be a type parameter" */ }
            _[P any] interface{ ~P /* ERROR "type in term ~P cannot be a type parameter" */ }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:25 UTC 2023
    - 2K bytes
    - Viewed (0)
  8. src/internal/types/testdata/check/builtins1.go

    // delete
    
    type M0 interface{ int }
    type M1 interface{ map[string]int }
    type M2 interface { map[string]int | map[string]float64 }
    type M3 interface{ map[string]int | map[rune]int }
    type M4[K comparable, V any] interface{ map[K]V | map[rune]V }
    
    func _[T any](m T) {
    	delete(m /* ERROR "not a map" */, "foo")
    }
    
    func _[T M0](m T) {
    	delete(m /* ERROR "not a map" */, "foo")
    }
    
    func _[T M1](m T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 18 21:16:29 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  9. src/internal/types/testdata/check/cycles0.go

    		i0 /* ERROR "invalid recursive type: i0 refers to itself" */ interface{ i0 }
    
    		// maps
    		m0 map[m0 /* ERROR "invalid map key" */ ]m0
    
    		// channels
    		c0 chan c0
    	)
    }
    
    // test cases for issue 6667
    
    type A [10]map[A /* ERROR "invalid map key" */ ]bool
    
    type S struct {
    	m map[S /* ERROR "invalid map key" */ ]bool
    }
    
    // test cases for issue 7236
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:25 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/ssa/testdata/b53456.go

    package main
    
    type T struct {
    	m map[int]int
    }
    
    func main() {
    	t := T{
    		m: make(map[int]int),
    	}
    	t.Inc(5)
    	t.Inc(7)
    }
    
    func (s *T) Inc(key int) {
    	v := s.m[key] // break, line 16
    	v++
    	s.m[key] = v // also here
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 11 21:21:49 UTC 2022
    - 215 bytes
    - Viewed (0)
Back to top