Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 32 for NewTypeName (0.25 sec)

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

    	// example by renaming the type parameter P into P2.
    	if len(tparams) == 0 {
    		return nil, typ // nothing to do
    	}
    
    	tparams2 := make([]*TypeParam, len(tparams))
    	for i, tparam := range tparams {
    		tname := NewTypeName(tparam.Obj().Pos(), tparam.Obj().Pkg(), tparam.Obj().Name(), nil)
    		tparams2[i] = NewTypeParam(tname, nil)
    		tparams2[i].index = tparam.index // == i
    	}
    
    	renameMap := makeRenameMap(tparams, tparams2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 13:54:20 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/named.go

    // led to the creation of this instance.
    func (check *Checker) newNamedInstance(pos syntax.Pos, orig *Named, targs []Type, expanding *Named) *Named {
    	assert(len(targs) > 0)
    
    	obj := NewTypeName(pos, orig.obj.pkg, orig.obj.name, nil)
    	inst := &instance{orig: orig, targs: newTypeList(targs)}
    
    	// Only pass the expanding context to the new instance if their packages
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 20:03:31 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/resolver.go

    				}
    
    				// If we have no type, we must have values.
    				if s.Type == nil || values != nil {
    					check.arity(s.Pos(), s.NameList, values, false, false)
    				}
    
    			case *syntax.TypeDecl:
    				obj := NewTypeName(s.Name.Pos(), pkg, s.Name.Value, nil)
    				check.declarePkgObj(s.Name, obj, &declInfo{file: fileScope, tdecl: s})
    
    			case *syntax.FuncDecl:
    				name := s.Name.Value
    				obj := NewFunc(s.Name.Pos(), pkg, name, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  4. src/go/types/named.go

    // led to the creation of this instance.
    func (check *Checker) newNamedInstance(pos token.Pos, orig *Named, targs []Type, expanding *Named) *Named {
    	assert(len(targs) > 0)
    
    	obj := NewTypeName(pos, orig.obj.pkg, orig.obj.name, nil)
    	inst := &instance{orig: orig, targs: newTypeList(targs)}
    
    	// Only pass the expanding context to the new instance if their packages
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 20:03:31 UTC 2024
    - 24K bytes
    - Viewed (0)
  5. src/go/types/resolver.go

    							init = d.spec.Values[i]
    						}
    						di = &declInfo{file: fileScope, vtyp: d.spec.Type, init: init}
    					}
    
    					check.declarePkgObj(name, obj, di)
    				}
    			case typeDecl:
    				obj := NewTypeName(d.spec.Name.Pos(), pkg, d.spec.Name.Name, nil)
    				check.declarePkgObj(d.spec.Name, obj, &declInfo{file: fileScope, tdecl: d.spec})
    			case funcDecl:
    				name := d.decl.Name.Name
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
  6. src/go/types/builtins.go

    		// Construct a suitable new type parameter for the result type.
    		// The type parameter is placed in the current package so export/import
    		// works as expected.
    		tpar := NewTypeName(nopos, check.pkg, tp.obj.name, nil)
    		ptyp := check.newTypeParam(tpar, NewInterfaceType(nil, []Type{NewUnion(terms)})) // assigns type to tpar as a side-effect
    		ptyp.index = tp.index
    
    		return ptyp
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/builtins.go

    		// Construct a suitable new type parameter for the result type.
    		// The type parameter is placed in the current package so export/import
    		// works as expected.
    		tpar := NewTypeName(nopos, check.pkg, tp.obj.name, nil)
    		ptyp := check.newTypeParam(tpar, NewInterfaceType(nil, []Type{NewUnion(terms)})) // assigns type to tpar as a side-effect
    		ptyp.index = tp.index
    
    		return ptyp
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  8. src/go/types/infer.go

    	// example by renaming the type parameter P into P2.
    	if len(tparams) == 0 {
    		return nil, typ // nothing to do
    	}
    
    	tparams2 := make([]*TypeParam, len(tparams))
    	for i, tparam := range tparams {
    		tname := NewTypeName(tparam.Obj().Pos(), tparam.Obj().Pkg(), tparam.Obj().Name(), nil)
    		tparams2[i] = NewTypeParam(tname, nil)
    		tparams2[i].index = tparam.index // == i
    	}
    
    	renameMap := makeRenameMap(tparams, tparams2)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 13:54:20 UTC 2024
    - 26.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/api_test.go

    				ObjectScopePos(wantObj))
    			continue
    		}
    	}
    }
    
    // newDefined creates a new defined type named T with the given underlying type.
    func newDefined(underlying Type) *Named {
    	tname := NewTypeName(nopos, nil, "T", nil)
    	return NewNamed(tname, underlying, nil)
    }
    
    func TestConvertibleTo(t *testing.T) {
    	for _, test := range []struct {
    		v, t Type
    		want bool
    	}{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 93.3K bytes
    - Viewed (0)
  10. src/go/types/api_test.go

    	}
    }
    
    // newDefined creates a new defined type named T with the given underlying type.
    // Helper function for use with TestIncompleteInterfaces only.
    func newDefined(underlying Type) *Named {
    	tname := NewTypeName(nopos, nil, "T", nil)
    	return NewNamed(tname, underlying, nil)
    }
    
    func TestConvertibleTo(t *testing.T) {
    	for _, test := range []struct {
    		v, t Type
    		want bool
    	}{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
Back to top