Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complx: doesn't correctly or consistently handle mismatched args #729

Closed
gopherbot opened this issue Apr 15, 2010 · 2 comments
Closed

complx: doesn't correctly or consistently handle mismatched args #729

gopherbot opened this issue Apr 15, 2010 · 2 comments

Comments

@gopherbot
Copy link
Contributor

by nt9591:

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.
@adg
Copy link
Contributor

adg commented Apr 15, 2010

Comment 1:

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

Status changed to Accepted.

Attachments:

  1. complex_test.go (267 bytes)

@rsc
Copy link
Contributor

rsc commented Apr 19, 2010

Comment 3:

This issue was closed by revision d97bbab.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants