Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for IsSlice3 (0.3 sec)

  1. src/cmd/compile/internal/ir/fmt.go

    		fmt.Fprintf(s, "[%v]", n.Index)
    
    	case OSLICE, OSLICESTR, OSLICEARR, OSLICE3, OSLICE3ARR:
    		n := n.(*SliceExpr)
    		exprFmt(n.X, s, nprec)
    		fmt.Fprint(s, "[")
    		if n.Low != nil {
    			fmt.Fprint(s, n.Low)
    		}
    		fmt.Fprint(s, ":")
    		if n.High != nil {
    			fmt.Fprint(s, n.High)
    		}
    		if n.Op().IsSlice3() {
    			fmt.Fprint(s, ":")
    			if n.Max != nil {
    				fmt.Fprint(s, n.Max)
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/typecheck/expr.go

    	} else {
    		n.SetType(types.NewPtr(t.Elem()))
    	}
    	return n
    }
    
    // tcSlice typechecks an OSLICE or OSLICE3 node.
    func tcSlice(n *ir.SliceExpr) ir.Node {
    	n.X = DefaultLit(Expr(n.X), nil)
    	n.Low = indexlit(Expr(n.Low))
    	n.High = indexlit(Expr(n.High))
    	n.Max = indexlit(Expr(n.Max))
    	hasmax := n.Op().IsSlice3()
    	l := n.X
    	if l.Type() == nil {
    		n.SetType(nil)
    		return n
    	}
    	if l.Type().IsArray() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  3. test/slice3.go

    Emmanuel Odeke <******@****.***> 1460323946 -0700
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 2.9K bytes
    - Viewed (0)
  4. test/escape_slice.go

    	var s []*int
    	i := 0 // ERROR "moved to heap: i"
    	s = append(s, &i)
    	return s[0]
    }
    
    func slice2() []*int {
    	var s []*int
    	i := 0 // ERROR "moved to heap: i"
    	s = append(s, &i)
    	return s
    }
    
    func slice3() *int {
    	var s []*int
    	i := 0 // ERROR "moved to heap: i"
    	s = append(s, &i)
    	for _, p := range s {
    		return p
    	}
    	return nil
    }
    
    func slice4(s []*int) { // ERROR "s does not escape"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  5. src/go/types/exprstring.go

    	case *ast.SliceExpr:
    		WriteExpr(buf, x.X)
    		buf.WriteByte('[')
    		if x.Low != nil {
    			WriteExpr(buf, x.Low)
    		}
    		buf.WriteByte(':')
    		if x.High != nil {
    			WriteExpr(buf, x.High)
    		}
    		if x.Slice3 {
    			buf.WriteByte(':')
    			if x.Max != nil {
    				WriteExpr(buf, x.Max)
    			}
    		}
    		buf.WriteByte(']')
    
    	case *ast.TypeAssertExpr:
    		WriteExpr(buf, x.X)
    		buf.WriteString(".(")
    		WriteExpr(buf, x.Type)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 08 19:31:44 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  6. src/go/types/index.go

    	case nil:
    		check.errorf(x, NonSliceableOperand, invalidOp+"cannot slice %s: %s has no core type", x, x.typ)
    		x.mode = invalid
    		return
    
    	case *Basic:
    		if isString(u) {
    			if e.Slice3 {
    				at := e.Max
    				if at == nil {
    					at = e // e.Index[2] should be present but be careful
    				}
    				check.error(at, InvalidSliceExpr, invalidOp+"3-index slice of string")
    				x.mode = invalid
    				return
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 16:17:05 UTC 2024
    - 11.2K bytes
    - Viewed (0)
  7. tests/upsert_test.go

    		}
    	}
    }
    
    func TestUpsertSlice(t *testing.T) {
    	langs := []Language{
    		{Code: "upsert-slice1", Name: "Upsert-slice1"},
    		{Code: "upsert-slice2", Name: "Upsert-slice2"},
    		{Code: "upsert-slice3", Name: "Upsert-slice3"},
    	}
    	DB.Clauses(clause.OnConflict{DoNothing: true}).Create(&langs)
    
    	var langs2 []Language
    	if err := DB.Find(&langs2, "code LIKE ?", "upsert-slice%").Error; err != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Sep 05 07:39:19 UTC 2022
    - 11.4K bytes
    - Viewed (0)
  8. src/reflect/all_test.go

    	}
    	rv = ValueOf(&xa).Elem()
    	shouldPanic("Slice3", func() { rv.Slice3(1, 2, 1) })
    	shouldPanic("Slice3", func() { rv.Slice3(1, 1, 11) })
    	shouldPanic("Slice3", func() { rv.Slice3(2, 2, 1) })
    
    	s := "hello world"
    	rv = ValueOf(&s).Elem()
    	shouldPanic("Slice3", func() { rv.Slice3(1, 2, 3) })
    
    	rv = ValueOf(&xs).Elem()
    	rv = rv.Slice3(3, 5, 7)
    	ptr2 := rv.UnsafePointer()
    	rv = rv.Slice3(4, 4, 4)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/walk/walk.go

    		default:
    			base.FatalfAt(n.Pos(), "mayCall %+v", n)
    
    		case ir.OCALLFUNC, ir.OCALLINTER,
    			ir.OUNSAFEADD, ir.OUNSAFESLICE:
    			return true
    
    		case ir.OINDEX, ir.OSLICE, ir.OSLICEARR, ir.OSLICE3, ir.OSLICE3ARR, ir.OSLICESTR,
    			ir.ODEREF, ir.ODOTPTR, ir.ODOTTYPE, ir.ODYNAMICDOTTYPE, ir.ODIV, ir.OMOD,
    			ir.OSLICE2ARR, ir.OSLICE2ARRPTR:
    			// These ops might panic, make sure they are done
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 20:56:00 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/walk/expr.go

    		n := n.(*ir.SliceHeaderExpr)
    		return walkSliceHeader(n, init)
    
    	case ir.OSTRINGHEADER:
    		n := n.(*ir.StringHeaderExpr)
    		return walkStringHeader(n, init)
    
    	case ir.OSLICE, ir.OSLICEARR, ir.OSLICESTR, ir.OSLICE3, ir.OSLICE3ARR:
    		n := n.(*ir.SliceExpr)
    		return walkSlice(n, init)
    
    	case ir.ONEW:
    		n := n.(*ir.UnaryExpr)
    		return walkNew(n, init)
    
    	case ir.OADDSTR:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 27.6K bytes
    - Viewed (0)
Back to top