Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 55 for TypeParam (0.2 sec)

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

    	if check != nil {
    		check.error(atPos(pos), WrongTypeArgCount, msg)
    		return false
    	}
    
    	panic(fmt.Sprintf("%v: %s", pos, msg))
    }
    
    func (check *Checker) verify(pos syntax.Pos, tparams []*TypeParam, targs []Type, ctxt *Context) (int, error) {
    	smap := makeSubstMap(tparams, targs)
    	for i, tpar := range tparams {
    		// Ensure that we have a (possibly implicit) interface as type bound (go.dev/issue/51048).
    		tpar.iface()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/decl.go

    		named.underlying = Typ[Invalid]
    	}
    }
    
    func (check *Checker) collectTypeParams(dst **TypeParamList, list []*syntax.Field) {
    	tparams := make([]*TypeParam, len(list))
    
    	// Declare type parameters up-front.
    	// The scope of type parameters starts at the beginning of the type parameter
    	// list (so we can have mutually recursive parameterized type bounds).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  3. src/go/types/issues_test.go

    		var n int
    		for x, tv := range types {
    			if x, _ := x.(*ast.CallExpr); x != nil {
    				// there must be exactly one CallExpr which is the P(val) conversion
    				n++
    				tpar, _ := tv.Type.(*TypeParam)
    				if tpar == nil {
    					t.Fatalf("%s: got type %s, want type parameter", ExprString(x), tv.Type)
    				}
    				if name := tpar.Obj().Name(); name != "P" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/issues_test.go

    		var n int
    		for x, tv := range types {
    			if x, _ := x.(*syntax.CallExpr); x != nil {
    				// there must be exactly one CallExpr which is the P(val) conversion
    				n++
    				tpar, _ := tv.Type.(*TypeParam)
    				if tpar == nil {
    					t.Fatalf("%s: got type %s, want type parameter", ExprString(x), tv.Type)
    				}
    				if name := tpar.Obj().Name(); name != "P" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 28.1K bytes
    - Viewed (0)
  5. src/go/types/instantiate.go

    	if check != nil {
    		check.error(atPos(pos), WrongTypeArgCount, msg)
    		return false
    	}
    
    	panic(fmt.Sprintf("%v: %s", pos, msg))
    }
    
    func (check *Checker) verify(pos token.Pos, tparams []*TypeParam, targs []Type, ctxt *Context) (int, error) {
    	smap := makeSubstMap(tparams, targs)
    	for i, tpar := range tparams {
    		// Ensure that we have a (possibly implicit) interface as type bound (go.dev/issue/51048).
    		tpar.iface()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 12.8K bytes
    - Viewed (0)
  6. src/go/types/generate_test.go

    	"termlist.go":      nil,
    	"termlist_test.go": nil,
    	"tuple.go":         nil,
    	"typelists.go":     nil,
    	"typeset.go":       func(f *ast.File) { fixTokenPos(f); renameSelectors(f, "Trace->_Trace") },
    	"typeparam.go":     nil,
    	"typeterm_test.go": nil,
    	"typeterm.go":      nil,
    	"typestring.go":    nil,
    	"under.go":         nil,
    	"unify.go":         fixSprintf,
    	"universe.go":      fixGlobalTypVarDecl,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:01:18 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  7. src/go/types/check.go

    	imports       []*PkgName                // list of imported packages
    	dotImportMap  map[dotImportKey]*PkgName // maps dot-imported objects to the package they were dot-imported through
    	recvTParamMap map[*ast.Ident]*TypeParam // maps blank receiver type parameters to their type
    	brokenAliases map[*TypeName]bool        // set of aliases with broken (not yet determined) types
    	unionTypeSets map[*Union]*_TypeSet      // computed type sets for union types
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/check.go

    	imports       []*PkgName                  // list of imported packages
    	dotImportMap  map[dotImportKey]*PkgName   // maps dot-imported objects to the package they were dot-imported through
    	recvTParamMap map[*syntax.Name]*TypeParam // maps blank receiver type parameters to their type
    	brokenAliases map[*TypeName]bool          // set of aliases with broken (not yet determined) types
    	unionTypeSets map[*Union]*_TypeSet        // computed type sets for union types
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.3K bytes
    - Viewed (0)
  9. src/go/types/resolver.go

    		//
    		// TODO(adonovan): unfortunately, Alias nodes
    		// (GODEBUG=gotypesalias=1) don't entirely resolve
    		// problems with cycles. For example, in
    		// GOROOT/test/typeparam/issue50259.go,
    		//
    		// 	type T[_ any] struct{}
    		// 	type A T[B]
    		// 	type B = T[A]
    		//
    		// TypeName A has Type Named during checking, but by
    		// the time the unified export data is written out,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
  10. src/go/types/builtins.go

    // applyTypeFunc returns nil.
    // If x is not a type parameter, the result is f(x).
    func (check *Checker) applyTypeFunc(f func(Type) Type, x *operand, id builtinId) Type {
    	if tp, _ := Unalias(x.typ).(*TypeParam); tp != nil {
    		// Test if t satisfies the requirements for the argument
    		// type and collect possible result types at the same time.
    		var terms []*Term
    		if !tp.is(func(t *term) bool {
    			if t == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
Back to top