Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for needTwoArgs (0.37 sec)

  1. src/cmd/compile/internal/typecheck/func.go

    			return typecheck(ir.InitExpr(n.Init(), u), top) // typecheckargs can add to old.Init
    
    		case ir.OCOMPLEX, ir.OCOPY, ir.OUNSAFEADD, ir.OUNSAFESLICE, ir.OUNSAFESTRING:
    			typecheckargs(n)
    			arg1, arg2, ok := needTwoArgs(n)
    			if !ok {
    				n.SetType(nil)
    				return n
    			}
    			b := ir.NewBinaryExpr(n.Pos(), l.BuiltinOp, arg1, arg2)
    			return typecheck(ir.InitExpr(n.Init(), b), top) // typecheckargs can add to old.Init
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/typecheck/typecheck.go

    	}
    
    	if len(n.Args) > 1 {
    		p := fmt.Sprintf(f, args...)
    		base.Errorf("too many arguments to %s: %v", p, n)
    		return n.Args[0], false
    	}
    
    	return n.Args[0], true
    }
    
    func needTwoArgs(n *ir.CallExpr) (ir.Node, ir.Node, bool) {
    	if len(n.Args) != 2 {
    		if len(n.Args) < 2 {
    			base.Errorf("not enough arguments in call to %v", n)
    		} else {
    			base.Errorf("too many arguments in call to %v", n)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
Back to top