1// errorcheck 2 3// Copyright 2010 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// Verify that incorrect invocations of the complex predeclared function are detected. 8// Does not compile. 9 10package main 11 12var ( 13 f32 float32 14 f64 float64 15 16 c64 complex64 17 c128 complex128 18) 19 20func main() { 21 // ok 22 c64 = complex(f32, f32) 23 c128 = complex(f64, f64) 24 25 _ = complex128(0) // ok 26 _ = complex(f32, f64) // ERROR "complex" 27 _ = complex(f64, f32) // ERROR "complex" 28} 29