// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package shifts func shifts0() { // basic constant shifts const ( s = 10 _ = 0<<0 _ = 1<> s) _, _, _ = u, v, x } func shifts4() { // shifts in comparisons w/ untyped operands var s uint _ = 1<> 1.1 /* ERROR "truncated to uint" */ // example from issue 11325 _ = 0 >> 1.1 /* ERROR "truncated to uint" */ _ = 0 << 1.1 /* ERROR "truncated to uint" */ _ = 0 >> 1. _ = 1 >> 1.1 /* ERROR "truncated to uint" */ _ = 1 >> 1. _ = 1. >> 1 _ = 1. >> 1. _ = 1.1 /* ERROR "must be integer" */ >> 1 } func issue11594() { var _ = complex64 /* ERROR "must be integer" */ (1) << 2 // example from issue 11594 _ = float32 /* ERROR "must be integer" */ (0) << 1 _ = float64 /* ERROR "must be integer" */ (0) >> 2 _ = complex64 /* ERROR "must be integer" */ (0) << 3 _ = complex64 /* ERROR "must be integer" */ (0) >> 4 } func issue21727() { var s uint var a = make([]int, 1<