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.
7 // Verify that incorrect invocations of the complex predeclared function are detected.
33 c64 = complex(f32, f32)
34 c128 = complex(f64, f64)
36 _ = complex128(0) // ok
37 _ = complex(f32, f64) // ERROR "complex"
38 _ = complex(f64, f32) // ERROR "complex"
39 _ = complex(f32, F32) // ERROR "complex"
40 _ = complex(F32, f32) // ERROR "complex"
41 _ = complex(f64, F64) // ERROR "complex"
42 _ = complex(F64, f64) // ERROR "complex"
44 c128 = complex(f32, f32) // ERROR "cannot use"
45 c64 = complex(f64, f64) // ERROR "cannot use"
47 c64 = complex(1.0, 2.0) // ok, constant is untyped
48 c128 = complex(1.0, 2.0)
49 C64 = complex(1.0, 2.0)
50 C128 = complex(1.0, 2.0)
52 C64 = complex(f32, f32) // ERROR "cannot use"
53 C128 = complex(f64, f64) // ERROR "cannot use"