Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for arityMatch (0.32 sec)

  1. src/go/types/decl.go

    					case last == nil:
    						last = new(ast.ValueSpec) // make sure last exists
    						inherited = false
    					}
    					check.arityMatch(s, last)
    					f(constDecl{spec: s, iota: iota, typ: last.Type, init: last.Values, inherited: inherited})
    				case token.VAR:
    					check.arityMatch(s, nil)
    					f(varDecl{s})
    				default:
    					check.errorf(s, InvalidSyntaxTree, "invalid token %s", d.Tok)
    				}
    			case *ast.TypeSpec:
    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/go/types/resolver.go

    		m = make(map[Object]bool)
    		d.deps = m
    	}
    	m[obj] = true
    }
    
    // arityMatch checks that the lhs and rhs of a const or var decl
    // have the appropriate number of names and init exprs. For const
    // decls, init is the value spec providing the init exprs; for
    // var decls, init is nil (the init exprs are in s in this case).
    func (check *Checker) arityMatch(s, init *ast.ValueSpec) {
    	l := len(s.Names)
    	r := len(s.Values)
    	if init != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 16:22:59 UTC 2024
    - 26.1K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/decl.go

    		// expr for each lhs variable, leading to duplicate work.
    	}
    
    	// check initialization
    	if init == nil {
    		if typ == nil {
    			// error reported before by arityMatch
    			obj.typ = Typ[Invalid]
    		}
    		return
    	}
    
    	if lhs == nil || len(lhs) == 1 {
    		assert(lhs == nil || lhs[0] == obj)
    		var x operand
    		check.expr(newTarget(obj.typ, obj.name), &x, init)
    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