github.com/mattn/go@v0.0.0-20171011075504-07f7db3ea99f/test/fixedbugs/issue20227.go (about)

     1  // errorcheck
     2  
     3  // Copyright 2017 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 20227: panic while constructing constant "1i/1e-600000000"
     8  
     9  package p
    10  
    11  var _ = 1 / 1e-600000000i  // ERROR "complex division by zero"
    12  var _ = 1i / 1e-600000000  // ERROR "complex division by zero"
    13  var _ = 1i / 1e-600000000i // ERROR "complex division by zero"
    14  
    15  var _ = 1 / (1e-600000000 + 1e-600000000i)  // ERROR "complex division by zero"
    16  var _ = 1i / (1e-600000000 + 1e-600000000i) // ERROR "complex division by zero"