Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 4,347 for const2 (0.15 sec)

  1. test/const3.go

    package main
    
    import "fmt"
    
    type T int
    
    func (t T) String() string { return fmt.Sprintf("T%d", int(t)) }
    
    const (
    	A T = 1 << (1 << iota)
    	B
    	C
    	D
    	E
    )
    
    func main() {
    	s := fmt.Sprintf("%v %v %v %v %v", A, B, C, D, E)
    	if s != "T2 T4 T16 T256 T65536" {
    		println("type info didn't propagate in const: got", s)
    		panic("fail")
    	}
    	x := uint(5)
    	y := float64(uint64(1)<<x)	// used to fail to compile
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Feb 19 02:19:43 UTC 2012
    - 659 bytes
    - Viewed (0)
  2. test/const1.go

    	f(Bool)             // ERROR "convert|wrong type|cannot|incompatible"
    }
    
    const ptr = nil // ERROR "const.*nil|not constant"
    const _ = string([]byte(nil)) // ERROR "is not a? ?constant"
    const _ = uintptr(unsafe.Pointer((*int)(nil))) // ERROR "is not a? ?constant"
    const _ = unsafe.Pointer((*int)(nil)) // ERROR "cannot be nil|invalid constant type|is not a constant|not constant"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 01 21:49:31 UTC 2020
    - 3.8K bytes
    - Viewed (0)
  3. src/runtime/internal/sys/consts.go

    const StackGuardMultiplier = 1 + goos.IsAix + isRace
    
    // DefaultPhysPageSize is the default physical page size.
    const DefaultPhysPageSize = goarch.DefaultPhysPageSize
    
    // PCQuantum is the minimal unit for a program counter (1 on x86, 4 on most other systems).
    // The various PC tables record PC deltas pre-divided by PCQuantum.
    const PCQuantum = goarch.PCQuantum
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 18 16:26:25 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  4. test/const.go

    package main
    
    import "os"
    
    const (
    	c0      = 0
    	cm1     = -1
    	chuge   = 1 << 100
    	chuge_1 = chuge - 1
    	c1      = chuge >> 100
    	c3div2  = 3 / 2
    	c1e3    = 1e3
    
    	rsh1 = 1e100 >> 1000
    	rsh2 = 1e302 >> 1000
    
    	ctrue  = true
    	cfalse = !ctrue
    
    	// Issue #34563
    	_ = string(int(123))
    	_ = string(rune(456))
    )
    
    const (
    	f0              = 0.0
    	fm1             = -1.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 26 23:54:29 UTC 2019
    - 4.8K bytes
    - Viewed (0)
  5. test/const5.go

    package p
    
    var b struct {
    	a[10]int
    }
    
    var m map[string][20]int
    
    var s [][30]int
    
    func f() *[40]int
    var c chan *[50]int
    var z complex128
    
    const (
    	n1 = len(b.a)
    	n2 = len(m[""])
    	n3 = len(s[10])
    
    	n4 = len(f())  // ERROR "is not a constant|is not constant"
    	n5 = len(<-c) // ERROR "is not a constant|is not constant"
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jul 11 14:36:33 UTC 2015
    - 835 bytes
    - Viewed (0)
  6. test/const6.go

    Emmanuel Odeke <******@****.***> 1460323946 -0700
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 834 bytes
    - Viewed (0)
  7. src/cmd/compile/internal/ssa/rewritedec64.go

    	for {
    		x := v_0
    		s := v_1
    		v.reset(OpInt64Make)
    		v0 := b.NewValue0(v.Pos, OpRsh32x32, typ.UInt32)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 19 22:42:34 UTC 2023
    - 65.3K bytes
    - Viewed (0)
  8. test/convT2X.go

    		println("second: got", got, "want", ip)
    		panic("fail")
    	}
    
    	// Test that non-interface types can be sent on a chan interface{}.
    	const n = 100
    	uc := make(chan interface{})
    	go func() {
    		for i := 0; i < n; i++ {
    			select {
    			case uc <- nil:
    			case uc <- u32:
    			case uc <- u64:
    			case uc <- u128:
    			}
    		}
    	}()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 02 23:09:05 UTC 2012
    - 3.3K bytes
    - Viewed (0)
  9. test/const7.go

    func main() {
    	if runtime.GOOS == "js" || runtime.GOOS == "wasip1" || runtime.Compiler != "gc" {
    		return
    	}
    
    	dir, err := ioutil.TempDir("", "const7_")
    	if err != nil {
    		log.Fatalf("creating temp dir: %v\n", err)
    	}
    	defer os.RemoveAll(dir)
    
    	const bitLimit = 512
    	const charLimit = 10000 // compiler-internal constant length limit
    	testProg(dir, "x1", bitLimit, "")
    	testProg(dir, "x2", bitLimit+1, "constant overflow")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/types2/const.go

    			case Int:
    				var s = uint(sizeof(typ)) * 8
    				return int64(-1)<<(s-1) <= x && x <= int64(1)<<(s-1)-1
    			case Int8:
    				const s = 8
    				return -1<<(s-1) <= x && x <= 1<<(s-1)-1
    			case Int16:
    				const s = 16
    				return -1<<(s-1) <= x && x <= 1<<(s-1)-1
    			case Int32:
    				const s = 32
    				return -1<<(s-1) <= x && x <= 1<<(s-1)-1
    			case Int64, UntypedInt:
    				return true
    			case Uint, Uintptr:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 19:32:17 UTC 2024
    - 7.5K bytes
    - Viewed (0)
Back to top