Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for newParam (0.3 sec)

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

    				check.error(field.Name, InvalidSyntaxTree, "anonymous parameter")
    				// ok to continue
    			}
    			par := NewParam(field.Name.Pos(), check.pkg, name, typ)
    			check.declare(scope, field.Name, par, scopePos)
    			params = append(params, par)
    			named = true
    		} else {
    			// anonymous parameter
    			par := NewParam(field.Pos(), check.pkg, "", typ)
    			check.recordImplicit(field, par)
    			params = append(params, par)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:33:05 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  2. src/go/types/object.go

    func NewVar(pos token.Pos, pkg *Package, name string, typ Type) *Var {
    	return &Var{object: object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}}
    }
    
    // NewParam returns a new variable representing a function parameter.
    func NewParam(pos token.Pos, pkg *Package, name string, typ Type) *Var {
    	return &Var{object: object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}, used: true} // parameters are always 'used'
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/object.go

    func NewVar(pos syntax.Pos, pkg *Package, name string, typ Type) *Var {
    	return &Var{object: object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}}
    }
    
    // NewParam returns a new variable representing a function parameter.
    func NewParam(pos syntax.Pos, pkg *Package, name string, typ Type) *Var {
    	return &Var{object: object{nil, pos, pkg, name, typ, 0, colorFor(typ), nopos}, used: true} // parameters are always 'used'
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  4. src/go/internal/gcimporter/iimport.go

    	for i := range xs {
    		xs[i] = r.param()
    	}
    	return types.NewTuple(xs...)
    }
    
    func (r *importReader) param() *types.Var {
    	pos := r.pos()
    	name := r.ident()
    	typ := r.typ()
    	return types.NewParam(pos, r.currPkg, name, typ)
    }
    
    func (r *importReader) bool() bool {
    	return r.uint64() != 0
    }
    
    func (r *importReader) int64() int64 {
    	n, err := binary.ReadVarint(&r.declReader)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  5. src/go/internal/gcimporter/ureader.go

    	}
    
    	return types.NewTuple(params...)
    }
    
    func (r *reader) param() *types.Var {
    	r.Sync(pkgbits.SyncParam)
    
    	pos := r.pos()
    	pkg, name := r.localIdent()
    	typ := r.typ()
    
    	return types.NewParam(pos, pkg, name, typ)
    }
    
    // @@@ Objects
    
    func (r *reader) obj() (types.Object, []types.Type) {
    	r.Sync(pkgbits.SyncObject)
    
    	assert(!r.Bool())
    
    	pkg, name := r.p.objIdx(r.Reloc(pkgbits.RelocObj))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/rangefunc/rewrite.go

    	obj := types2.NewFunc(nopos, pkg, "deferrangefunc", types2.NewSignatureType(nil, nil, nil, nil, types2.NewTuple(types2.NewParam(nopos, pkg, "extra", anyType)), false))
    	pkg.Scope().Insert(obj)
    
    	// func panicrangestate()
    	obj = types2.NewFunc(nopos, pkg, "panicrangestate", types2.NewSignatureType(nil, nil, nil, types2.NewTuple(types2.NewParam(nopos, pkg, "state", intType)), nil, false))
    	pkg.Scope().Insert(obj)
    
    	return pkg
    }()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  7. src/go/types/call.go

    				copy(vars, sig.params.vars)
    				last := sig.params.vars[npars-1]
    				typ := last.typ.(*Slice).elem
    				for len(vars) < nargs {
    					vars = append(vars, NewParam(last.pos, last.pkg, last.name, typ))
    				}
    				sigParams = NewTuple(vars...) // possibly nil!
    				adjusted = true
    				npars = nargs
    			} else {
    				// nargs < npars-1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 33.5K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/types2/call.go

    				copy(vars, sig.params.vars)
    				last := sig.params.vars[npars-1]
    				typ := last.typ.(*Slice).elem
    				for len(vars) < nargs {
    					vars = append(vars, NewParam(last.pos, last.pkg, last.name, typ))
    				}
    				sigParams = NewTuple(vars...) // possibly nil!
    				adjusted = true
    				npars = nargs
    			} else {
    				// nargs < npars-1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31.5K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/api_test.go

    	//
    	// It must be possible for importers to construct such invalid interfaces.
    	// Previously, this panicked.
    
    	sig1 := NewSignatureType(nil, nil, nil, NewTuple(NewParam(nopos, nil, "", Typ[Int])), nil, false)
    	sig2 := NewSignatureType(nil, nil, nil, NewTuple(NewParam(nopos, nil, "", Typ[String])), nil, false)
    
    	methods := []*Func{
    		NewFunc(nopos, nil, "M", sig1),
    		NewFunc(nopos, nil, "M", sig2),
    	}
    
    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

    	//
    	// It must be possible for importers to construct such invalid interfaces.
    	// Previously, this panicked.
    
    	sig1 := NewSignatureType(nil, nil, nil, NewTuple(NewParam(nopos, nil, "", Typ[Int])), nil, false)
    	sig2 := NewSignatureType(nil, nil, nil, NewTuple(NewParam(nopos, nil, "", Typ[String])), nil, false)
    
    	methods := []*Func{
    		NewFunc(nopos, nil, "M", sig1),
    		NewFunc(nopos, nil, "M", sig2),
    	}
    
    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