Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 28 for NewVar (0.33 sec)

  1. src/cmd/compile/internal/rangefunc/rewrite.go

    	return x
    }
    
    func (r *rewriter) stateVar(pos syntax.Pos) (*types2.Var, *syntax.VarDecl) {
    	r.stateVarCount++
    
    	name := fmt.Sprintf("#state%d", r.stateVarCount)
    	typ := r.int.Type()
    	obj := types2.NewVar(pos, r.pkg, name, typ)
    	n := syntax.NewName(pos, name)
    	setValueType(n, typ)
    	r.info.Defs[n] = obj
    
    	return obj, &syntax.VarDecl{NameList: []*syntax.Name{n}, Values: r.stateConst(abi.RF_READY)}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:05:44 UTC 2024
    - 41.6K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/object.go

    	isField  bool // var is struct field
    	used     bool // set if the variable was used
    	origin   *Var // if non-nil, the Var from which this one was instantiated
    }
    
    // NewVar returns a new variable.
    // The arguments set the attributes found with all Objects.
    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}}
    }
    
    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/go/types/check.go

    	if m := check.Types; m != nil {
    		for {
    			tv := m[x]
    			assert(tv.Type != nil) // should have been recorded already
    			pos := x.Pos()
    			tv.Type = NewTuple(
    				NewVar(pos, check.pkg, "", t0),
    				NewVar(pos, check.pkg, "", t1),
    			)
    			m[x] = tv
    			// if x is a parenthesized expression (p.X), update p.X
    			p, _ := x.(*ast.ParenExpr)
    			if p == nil {
    				break
    			}
    			x = p.X
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  4. src/go/types/builtins.go

    func makeSig(res Type, args ...Type) *Signature {
    	list := make([]*Var, len(args))
    	for i, param := range args {
    		list[i] = NewVar(nopos, nil, "", Default(param))
    	}
    	params := NewTuple(list...)
    	var result *Tuple
    	if res != nil {
    		assert(!isUntyped(res))
    		result = NewTuple(NewVar(nopos, nil, "", res))
    	}
    	return &Signature{params: params, results: result}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/builtins.go

    func makeSig(res Type, args ...Type) *Signature {
    	list := make([]*Var, len(args))
    	for i, param := range args {
    		list[i] = NewVar(nopos, nil, "", Default(param))
    	}
    	params := NewTuple(list...)
    	var result *Tuple
    	if res != nil {
    		assert(!isUntyped(res))
    		result = NewTuple(NewVar(nopos, nil, "", res))
    	}
    	return &Signature{params: params, results: result}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/call.go

    				} else {
    					check.versionErrorf(instErrPos, go1_21, "implicitly instantiated function in assignment")
    				}
    			}
    			gsig := NewSignatureType(nil, nil, nil, sig.params, sig.results, sig.variadic)
    			params = []*Var{NewVar(x.Pos(), check.pkg, "", gsig)}
    			// The type of the argument operand is tsig, which is the type of the LHS in an assignment
    			// or the result type in a return statement. Create a pseudo-expression for that operand
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31.5K bytes
    - Viewed (0)
  7. src/go/types/call.go

    				} else {
    					check.versionErrorf(instErrPos, go1_21, "implicitly instantiated function in assignment")
    				}
    			}
    			gsig := NewSignatureType(nil, nil, nil, sig.params, sig.results, sig.variadic)
    			params = []*Var{NewVar(x.Pos(), check.pkg, "", gsig)}
    			// The type of the argument operand is tsig, which is the type of the LHS in an assignment
    			// or the result type in a return statement. Create a pseudo-expression for that operand
    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/resolver.go

    					d1 = &declInfo{file: fileScope, lhs: lhs, vtyp: s.Type, init: s.Values}
    				}
    
    				// declare all variables
    				values := syntax.UnpackListExpr(s.Values)
    				for i, name := range s.NameList {
    					obj := NewVar(name.Pos(), pkg, name.Value, nil)
    					lhs[i] = obj
    
    					d := d1
    					if d == nil {
    						// individual assignments
    						var init syntax.Expr
    						if i < len(values) {
    							init = values[i]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  9. src/go/types/resolver.go

    					// for a later phase.
    					d1 = &declInfo{file: fileScope, lhs: lhs, vtyp: d.spec.Type, init: d.spec.Values[0]}
    				}
    
    				// declare all variables
    				for i, name := range d.spec.Names {
    					obj := NewVar(name.Pos(), pkg, name.Name, nil)
    					lhs[i] = obj
    
    					di := d1
    					if di == nil {
    						// individual assignments
    						var init ast.Expr
    						if i < len(d.spec.Values) {
    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/cmd/compile/internal/types2/decl.go

    				check.declare(check.scope, name, lhs[i], scopePos)
    			}
    
    		case *syntax.VarDecl:
    			top := len(check.delayed)
    
    			lhs0 := make([]*Var, len(s.NameList))
    			for i, name := range s.NameList {
    				lhs0[i] = NewVar(name.Pos(), pkg, name.Value, nil)
    			}
    
    			// initialize all variables
    			values := syntax.UnpackListExpr(s.Values)
    			for i, obj := range lhs0 {
    				var lhs []*Var
    				var init syntax.Expr
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
Back to top