Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 26 for IsBoolean (0.13 sec)

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

    // tcFor typechecks an OFOR node.
    func tcFor(n *ir.ForStmt) ir.Node {
    	Stmts(n.Init())
    	n.Cond = Expr(n.Cond)
    	n.Cond = DefaultLit(n.Cond, nil)
    	if n.Cond != nil {
    		t := n.Cond.Type()
    		if t != nil && !t.IsBoolean() {
    			base.Errorf("non-bool %L used as for condition", n.Cond)
    		}
    	}
    	n.Post = Stmt(n.Post)
    	Stmts(n.Body)
    	return n
    }
    
    // tcGoDefer typechecks (normalizes) an OGO/ODEFER statement.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 20 15:10:54 UTC 2023
    - 17.8K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/typecheck/typecheck.go

    		// can't be converted to int (see issue #41500).
    		if !n.X.Type().IsBoolean() {
    			base.Errorf("invalid operation: %v (operator %v not defined on %s)", n, n.Op(), typekind(n.X.Type()))
    			n.SetType(nil)
    			return n
    		}
    		if !n.Y.Type().IsBoolean() {
    			base.Errorf("invalid operation: %v (operator %v not defined on %s)", n, n.Op(), typekind(n.Y.Type()))
    			n.SetType(nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go

    		under = n.Underlying()
    	}
    	switch under := under.(type) {
    	case *types.Basic:
    		switch {
    		case under.Info()&types.IsNumeric != 0:
    			return &ast.BasicLit{Kind: token.INT, Value: "0"}
    		case under.Info()&types.IsBoolean != 0:
    			return &ast.Ident{Name: "false"}
    		case under.Info()&types.IsString != 0:
    			return &ast.BasicLit{Kind: token.STRING, Value: `""`}
    		default:
    			panic(fmt.Sprintf("unknown basic type %v", under))
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/ssa/shortcircuit.go

    	//
    	// We can replace the "a" in the phi with the constant true.
    	var ct, cf *Value
    	for _, b := range f.Blocks {
    		for _, v := range b.Values {
    			if v.Op != OpPhi {
    				continue
    			}
    			if !v.Type.IsBoolean() {
    				continue
    			}
    			for i, a := range v.Args {
    				e := b.Preds[i]
    				p := e.b
    				if p.Kind != BlockIf {
    					continue
    				}
    				if p.Controls[0] != a {
    					continue
    				}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 03 17:47:02 UTC 2022
    - 12.6K bytes
    - Viewed (0)
  5. src/go/internal/gcimporter/iimport.go

    	if r.p.exportVersion >= iexportVersionGo1_18 {
    		// TODO: add support for using the kind
    		_ = constant.Kind(r.int64())
    	}
    
    	switch b := typ.Underlying().(*types.Basic); b.Info() & types.IsConstType {
    	case types.IsBoolean:
    		val = constant.MakeBool(r.bool())
    
    	case types.IsString:
    		val = constant.MakeString(r.string())
    
    	case types.IsInteger:
    		var x big.Int
    		r.mpint(&x, b)
    		val = constant.Make(&x)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  6. api/go1.5.txt

    pkg go/types, const Int64 BasicKind
    pkg go/types, const Int8 = 3
    pkg go/types, const Int8 BasicKind
    pkg go/types, const Invalid = 0
    pkg go/types, const Invalid BasicKind
    pkg go/types, const IsBoolean = 1
    pkg go/types, const IsBoolean BasicInfo
    pkg go/types, const IsComplex = 16
    pkg go/types, const IsComplex BasicInfo
    pkg go/types, const IsConstType = 59
    pkg go/types, const IsConstType BasicInfo
    pkg go/types, const IsFloat = 8
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jul 30 21:14:09 UTC 2015
    - 46.6K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/assign.go

    	// mapaccess2* returns a typed bool, but due to spec changes,
    	// the boolean result of i.(T) is now untyped so we make it the
    	// same type as the variable on the lhs.
    	if ok := n.Lhs[1]; !ir.IsBlank(ok) && ok.Type().IsBoolean() {
    		call.Type().Field(1).Type = ok.Type()
    	}
    	n.Rhs = []ir.Node{call}
    	n.SetOp(ir.OAS2FUNC)
    
    	// don't generate a = *var if a is _
    	if ir.IsBlank(a) {
    		return walkExpr(typecheck.Stmt(n), init)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 17:09:06 UTC 2024
    - 20.3K bytes
    - Viewed (0)
  8. src/go/types/builtins.go

    		// assert(pred) causes a typechecker error if pred is false.
    		// The result of assert is the value of pred if there is no error.
    		// Note: assert is only available in self-test mode.
    		if x.mode != constant_ || !isBoolean(x.typ) {
    			check.errorf(x, Test, invalidArg+"%s is not a boolean constant", x)
    			return
    		}
    		if x.val.Kind() != constant.Bool {
    			check.errorf(x, Test, "internal error: value of %s should be a boolean constant", x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/types2/builtins.go

    		// assert(pred) causes a typechecker error if pred is false.
    		// The result of assert is the value of pred if there is no error.
    		// Note: assert is only available in self-test mode.
    		if x.mode != constant_ || !isBoolean(x.typ) {
    			check.errorf(x, Test, invalidArg+"%s is not a boolean constant", x)
    			return
    		}
    		if x.val.Kind() != constant.Bool {
    			check.errorf(x, Test, "internal error: value of %s should be a boolean constant", x)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 27.1K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/stmt.go

    		assert(cb.Recv() == nil)
    		switch {
    		case cb.Params().Len() > 2:
    			return bad("func must be func(yield func(...) bool): yield func has too many parameters")
    		case cb.Results().Len() != 1 || !isBoolean(cb.Results().At(0).Type()):
    			return bad("func must be func(yield func(...) bool): yield func does not return bool")
    		}
    		if cb.Params().Len() >= 1 {
    			key = cb.Params().At(0).Type()
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 19:19:55 UTC 2024
    - 30.7K bytes
    - Viewed (0)
Back to top