You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
When compiling the Go source code.
8g test.go
test.go includes the code as follows,
1 var f32 float32
2 var f64 float64
3 var c64 complex64
4 var c128 complex128
5 c64 = cmpl(f32, f64) // No error
6 c64 = cmpl(f64, f32) // Error 1
7 c128 = cmpl(f64, f32) // No error
8 c128 = cmpl(f32, f64) // Error 2
Line 6 & 8 are rejected by the compiler.
But line 5 & 7 are accepted normally.
What is the expected output? What do you see instead?
The compiler should reject line 5 & 7, similarly to line 6 & 8.
What is your $GOOS? $GOARCH?
$GOARCH=386
$GOOS=linux
Which revision are you using? (hg identify)
f98f784927ab release.2010-04-13/release
Please provide any additional information below.
None.
The text was updated successfully, but these errors were encountered:
Verified.
adg@quoll:~$ 6g -V
6g version 5275+
$ 6g complex_test.go
complex_test.go:9: cannot use cmplx(f64, f32) (type complex128) as type complex64 in
assignment
complex_test.go:11: cannot use cmplx(f32, f64) (type complex64) as type complex128 in
assignment
by nt9591:
The text was updated successfully, but these errors were encountered: