3 // Copyright 2021 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Test cases where a main dictionary is needed inside a generic function/method, because
8 // we are calling a method on a fully-instantiated type or a fully-instantiated function.
9 // (probably not common situations, of course)
19 type value[T C] struct {
23 func (v *value[T]) test(def T) bool {
27 func (v *value[T]) get(def T) T {
31 } else if v.test(def) {
40 if got, want := s.get("ab"), ""; got != want {
41 panic(fmt.Sprintf("get() == %d, want %d", got, want))