Source file src/internal/types/testdata/fixedbugs/issue52080.go

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package p
     6  
     7  var s int
     8  var _ int = (1.0 << s) << 1
     9  var _ int = (1.1 /* ERROR "must be integer" */ << s) << 1
    10  var _ = (1.0 /* ERROR "must be integer" */ << s) << 1
    11  
    12  // test case from issue
    13  
    14  func _(x int, s uint) {
    15  	x = (1. << s) << (1 << s)
    16  	x = (1. << s) << (1. << s)
    17  }
    18  

View as plain text