Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 68 for newNames (0.18 sec)

  1. src/vendor/golang.org/x/net/dns/dnsmessage/message.go

    // A Name is a non-encoded and non-escaped domain name. It is used instead of strings to avoid
    // allocations.
    type Name struct {
    	Data   [255]byte
    	Length uint8
    }
    
    // NewName creates a new Name from a string.
    func NewName(name string) (Name, error) {
    	n := Name{Length: uint8(len(name))}
    	if len(name) > len(n.Data) {
    		return Name{}, errCalcLen
    	}
    	copy(n.Data[:], name)
    	return n, nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Mar 09 00:09:40 UTC 2024
    - 69K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types/type.go

    	TypeInt128.align = 8
    }
    
    // NewNamed returns a new named type for the given type name. obj should be an
    // ir.Name. The new type is incomplete (marked as TFORW kind), and the underlying
    // type should be set later via SetUnderlying(). References to the type are
    // maintained until the type is filled in, so those references can be updated when
    // the type is complete.
    func NewNamed(obj Object) *Type {
    	t := newType(TFORW)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 49.5K bytes
    - Viewed (0)
  3. src/cmd/cgo/gcc.go

    	if addPosition {
    		getNewIdent = func(newName string) *ast.Ident {
    			mangledIdent := ast.NewIdent(newName)
    			if len(newName) == len(r.Name.Go) {
    				return mangledIdent
    			}
    			p := fset.Position((*r.Expr).End())
    			if p.Column == 0 {
    				return mangledIdent
    			}
    			return ast.NewIdent(fmt.Sprintf("%s /*line :%d:%d*/", newName, p.Line, p.Column))
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 97K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/decl.go

    		}
    		return
    	}
    
    	// type definition or generic type declaration
    	if !versionErr && tparam0 != nil && !check.verifyVersionf(tparam0, go1_18, "type parameter") {
    		versionErr = true
    	}
    
    	named := check.newNamed(obj, nil, nil)
    	setDefType(def, named)
    
    	if tdecl.TParamList != nil {
    		check.openScope(tdecl, "type parameters")
    		defer check.closeScope()
    		check.collectTypeParams(&named.tparams, tdecl.TParamList)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/resolver.go

    				default:
    					check.errorf(arg, BadDecl, "receiver type parameter %s must be an identifier", arg)
    				}
    				if par == nil {
    					par = syntax.NewName(arg.Pos(), "_")
    				}
    				tparams = append(tparams, par)
    			}
    
    		}
    	}
    
    	// unpack receiver name
    	if name, _ := rtyp.(*syntax.Name); name != nil {
    		rname = name
    	}
    
    	return
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  6. src/go/types/decl.go

    		}
    		return
    	}
    
    	// type definition or generic type declaration
    	if !versionErr && tparam0 != nil && !check.verifyVersionf(tparam0, go1_18, "type parameter") {
    		versionErr = true
    	}
    
    	named := check.newNamed(obj, nil, nil)
    	setDefType(def, named)
    
    	if tdecl.TypeParams != nil {
    		check.openScope(tdecl, "type parameters")
    		defer check.closeScope()
    		check.collectTypeParams(&named.tparams, tdecl.TypeParams)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31K bytes
    - Viewed (0)
  7. src/go/internal/gccgoimporter/parser.go

    		return t
    	}
    
    	// defined type
    	if obj == nil {
    		// A named type may be referred to before the underlying type
    		// is known - set it up.
    		tname := types.NewTypeName(token.NoPos, pkg, name, nil)
    		types.NewNamed(tname, nil, nil)
    		scope.Insert(tname)
    		obj = tname
    	}
    
    	// use the previously imported (canonical), or newly created type
    	t := obj.Type()
    	p.update(t, nlist)
    
    	nt, ok := t.(*types.Named)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 02 23:14:07 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/stmt.go

    		x.typ = Typ[Bool]
    		x.val = constant.MakeBool(true)
    		// TODO(gri) should have a better position here
    		pos := s.Rbrace
    		if len(s.Body) > 0 {
    			pos = s.Body[0].Pos()
    		}
    		x.expr = syntax.NewName(pos, "true")
    	}
    
    	check.multipleSwitchDefaults(s.Body)
    
    	seen := make(valueMap) // map of seen case values to positions and types
    	for i, clause := range s.Body {
    		if clause == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/call.go

    			// or the result type in a return statement. Create a pseudo-expression for that operand
    			// that makes sense when reported in error messages from infer, below.
    			expr := syntax.NewName(x.Pos(), T.desc)
    			args = []*operand{{mode: value, expr: expr, typ: T.sig}}
    			reverse = true
    		}
    
    		// Rename type parameters to avoid problems with recursive instantiations.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31.5K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/api_test.go

    			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
    	}{
    		{Typ[Int], Typ[Int], true},
    		{Typ[Int], Typ[Float32], true},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 93.3K bytes
    - Viewed (0)
Back to top