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

conversion of untyped complex to complex64 #1402

Closed
mvertes opened this issue May 24, 2022 · 0 comments · Fixed by #1403
Closed

conversion of untyped complex to complex64 #1402

mvertes opened this issue May 24, 2022 · 0 comments · Fixed by #1403
Assignees
Labels
area/core bug Something isn't working
Milestone

Comments

@mvertes
Copy link
Member

mvertes commented May 24, 2022

The following program sample.go triggers an unexpected result

package main

import "fmt"

func f() complex64 { return complex(0, 0) }

func main() {
	fmt.Println(f())
}

Expected result

$ go run ./sample.go
(0+0i)

Got

$ yaegi ./sample.go
run: /Users/marc/sample.go:5:29: cannot use  (type complex128T) as type complex64T in return argument

Yaegi Version

v0.12.0

Additional Notes

No response

@mvertes mvertes added bug Something isn't working area/core labels May 24, 2022
@mvertes mvertes added this to the v0.12.x milestone May 24, 2022
mvertes added a commit to mvertes/yaegi that referenced this issue May 24, 2022
For untyped numerical types, conversions to different numerical
types can be allowed if there is no overflow (not checked here).

Fixes traefik#1402.
@mvertes mvertes self-assigned this May 24, 2022
traefiker pushed a commit that referenced this issue Jun 13, 2022
For untyped numerical types, conversions to different numerical
types can be allowed if there is no overflow (not checked here).

Fixes #1402.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant