Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 101 for TypeParam (0.19 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go

    	if typ == nil || seen[typ] {
    		return nil
    	}
    	if seen == nil {
    		seen = make(map[types.Type]bool)
    	}
    	seen[typ] = true
    
    	if tpar, ok := aliases.Unalias(typ).(*types.TypeParam); ok {
    		terms, err := typeparams.StructuralTerms(tpar)
    		if err != nil {
    			return nil // invalid type
    		}
    		for _, term := range terms {
    			subpath := lockPath(tpkg, term.Type(), seen)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  2. src/go/types/index.go

    		// TODO(gri) report detailed failure cause for better error messages
    		var key, elem Type // key != nil: we must have all maps
    		mode := variable   // non-maps result mode
    		// TODO(gri) factor out closure and use it for non-typeparam cases as well
    		if typ.typeSet().underIs(func(u Type) bool {
    			l := int64(-1) // valid if >= 0
    			var k, e Type  // k is only set for maps
    			switch t := u.(type) {
    			case *Basic:
    				if isString(t) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/index.go

    		// TODO(gri) report detailed failure cause for better error messages
    		var key, elem Type // key != nil: we must have all maps
    		mode := variable   // non-maps result mode
    		// TODO(gri) factor out closure and use it for non-typeparam cases as well
    		if typ.typeSet().underIs(func(u Type) bool {
    			l := int64(-1) // valid if >= 0
    			var k, e Type  // k is only set for maps
    			switch t := u.(type) {
    			case *Basic:
    				if isString(t) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 15 16:16:58 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. 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)
  10. 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)
Back to top