Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for varType (0.55 sec)

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

    func (check *Checker) typ(e syntax.Expr) Type {
    	return check.definedType(e, nil)
    }
    
    // varType type-checks the type expression e and returns its type, or Typ[Invalid].
    // The type must not be an (uninstantiated) generic type and it must not be a
    // constraint interface.
    func (check *Checker) varType(e syntax.Expr) Type {
    	typ := check.definedType(e, nil)
    	check.validVarType(e, typ)
    	return typ
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  2. src/go/types/typexpr.go

    func (check *Checker) typ(e ast.Expr) Type {
    	return check.definedType(e, nil)
    }
    
    // varType type-checks the type expression e and returns its type, or Typ[Invalid].
    // The type must not be an (uninstantiated) generic type and it must not be a
    // constraint interface.
    func (check *Checker) varType(e ast.Expr) Type {
    	typ := check.definedType(e, nil)
    	check.validVarType(e, typ)
    	return typ
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 16.3K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/signature.go

    					variadic = true
    				} else {
    					check.softErrorf(t, MisplacedDotDotDot, "can only use ... with final parameter in list")
    					// ignore ... and continue
    				}
    			}
    			typ = check.varType(ftype)
    		}
    		// The parser ensures that f.Tag is nil and we don't
    		// care if a constructed AST contains a non-nil tag.
    		if field.Name != nil {
    			// named parameter
    			name := field.Name.Value
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:33:05 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  4. src/go/types/builtins.go

    		}
    
    		x.typ = resTyp
    
    	case _Make:
    		// make(T, n)
    		// make(T, n, m)
    		// (no argument evaluated yet)
    		arg0 := argList[0]
    		T := check.varType(arg0)
    		if !isValid(T) {
    			return
    		}
    
    		var min int // minimum number of arguments
    		switch coreType(T).(type) {
    		case *Slice:
    			min = 2
    		case *Map, *Chan:
    			min = 1
    		case nil:
    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/go/types/stmt.go

    		// The spec allows the value nil instead of a type.
    		if check.isNil(e) {
    			T = nil
    			check.expr(nil, &dummy, e) // run e through expr so we get the usual Info recordings
    		} else {
    			T = check.varType(e)
    			if !isValid(T) {
    				continue L
    			}
    		}
    		// look for duplicate types
    		// (quadratic algorithm, but type switches tend to be reasonably small)
    		for t, other := range seen {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.6K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/builtins.go

    		}
    
    		x.typ = resTyp
    
    	case _Make:
    		// make(T, n)
    		// make(T, n, m)
    		// (no argument evaluated yet)
    		arg0 := argList[0]
    		T := check.varType(arg0)
    		if !isValid(T) {
    			return
    		}
    
    		var min int // minimum number of arguments
    		switch coreType(T).(type) {
    		case *Slice:
    			min = 2
    		case *Map, *Chan:
    			min = 1
    		case nil:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/types2/stmt.go

    		// The spec allows the value nil instead of a type.
    		if check.isNil(e) {
    			T = nil
    			check.expr(nil, &dummy, e) // run e through expr so we get the usual Info recordings
    		} else {
    			T = check.varType(e)
    			if !isValid(T) {
    				continue L
    			}
    		}
    		// look for duplicate types
    		// (quadratic algorithm, but type switches tend to be reasonably small)
    		for t, other := range seen {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
  8. src/go/types/expr.go

    					// We have an "open" [...]T array type.
    					// Create a new ArrayType with unknown length (-1)
    					// and finish setting it up after analyzing the literal.
    					typ = &Array{len: -1, elem: check.varType(atyp.Elt)}
    					base = typ
    					break
    				}
    			}
    			typ = check.typ(e.Type)
    			base = typ
    
    		case hint != nil:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 49.7K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/decl.go

    	}
    	check.initConst(obj, &x)
    }
    
    func (check *Checker) varDecl(obj *Var, lhs []*Var, typ, init syntax.Expr) {
    	assert(obj.typ == nil)
    
    	// determine type, if any
    	if typ != nil {
    		obj.typ = check.varType(typ)
    		// We cannot spread the type to all lhs variables if there
    		// are more than one since that would mark them as checked
    		// (see Checker.objDecl) and the assignment of init exprs,
    		// if any, would not be checked.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 29.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/expr.go

    				// We have an "open" [...]T array type.
    				// Create a new ArrayType with unknown length (-1)
    				// and finish setting it up after analyzing the literal.
    				typ = &Array{len: -1, elem: check.varType(atyp.Elem)}
    				base = typ
    				break
    			}
    			typ = check.typ(e.Type)
    			base = typ
    
    		case hint != nil:
    			// no composite literal type present - use hint (element type of enclosing type)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 02:09:54 UTC 2024
    - 51.7K bytes
    - Viewed (0)
Back to top