Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for varDecl (0.17 sec)

  1. src/go/types/decl.go

    		iota      int
    		typ       ast.Expr
    		init      []ast.Expr
    		inherited bool
    	}
    	varDecl  struct{ spec *ast.ValueSpec }
    	typeDecl struct{ spec *ast.TypeSpec }
    	funcDecl struct{ decl *ast.FuncDecl }
    )
    
    func (d importDecl) node() ast.Node { return d.spec }
    func (d constDecl) node() ast.Node  { return d.spec }
    func (d varDecl) node() ast.Node    { return d.spec }
    func (d typeDecl) node() ast.Node   { return d.spec }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 31K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/types2/decl.go

    	switch obj := obj.(type) {
    	case *Const:
    		check.decl = d // new package-level const decl
    		check.constDecl(obj, d.vtyp, d.init, d.inherited)
    	case *Var:
    		check.decl = d // new package-level var decl
    		check.varDecl(obj, d.lhs, d.vtyp, d.init)
    	case *TypeName:
    		// invalid recursive types are detected via path
    		check.typeDecl(obj, d.tdecl, def)
    		check.collectMethods(obj) // methods can only be added to top-level types
    	case *Func:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  3. 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)
  4. src/cmd/compile/internal/types2/resolver.go

    					check.declarePkgObj(name, obj, d)
    				}
    
    				// Constants must always have init values.
    				check.arity(s.Pos(), s.NameList, values, true, inherited)
    
    			case *syntax.VarDecl:
    				lhs := make([]*Var, len(s.NameList))
    				// If there's exactly one rhs initializer, use
    				// the same declInfo d1 for all lhs variables
    				// so that each lhs variable depends on the same
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 14:10:44 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  5. src/go/types/resolver.go

    					if i < len(d.init) {
    						init = d.init[i]
    					}
    
    					d := &declInfo{file: fileScope, vtyp: d.typ, init: init, inherited: d.inherited}
    					check.declarePkgObj(name, obj, d)
    				}
    
    			case varDecl:
    				lhs := make([]*Var, len(d.spec.Names))
    				// If there's exactly one rhs initializer, use
    				// the same declInfo d1 for all lhs variables
    				// so that each lhs variable depends on the same
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
Back to top