...
Run Format

Source file test/fixedbugs/issue6131.go

Documentation: test/fixedbugs

     1  // compile
     2  
     3  // Copyright 2013 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  // Issue 6131: missing typecheck after reducing
     8  // n%1 == 0 to a constant value.
     9  
    10  package main
    11  
    12  func isGood(n int) bool {
    13  	return n%1 == 0
    14  }
    15  
    16  func main() {
    17  	if !isGood(256) {
    18  		panic("!isGood")
    19  	}
    20  }
    21  

View as plain text