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

go/types: no error on "x int = complex(1<<s, 2)" #5029

remyoudompheng opened this issue Mar 11, 2013 · 3 comments

go/types: no error on "x int = complex(1<<s, 2)" #5029

remyoudompheng opened this issue Mar 11, 2013 · 3 comments


Copy link

What steps will reproduce the problem?
1. Run gotype ( on:

package main

var (
      s uint = 20
      x int = complex(1<<s, 2)

What is the expected output? What do you see instead?

Expected: something like
truc.go:5:??: cannot assign complex(1<<s, 2) (untyped complex) to x of type int

Got: no error.

Please use labels and text to provide additional information.
Copy link

rsc commented Mar 12, 2013

Comment 1:

[The time for maybe has passed.]

Copy link

Comment 2:

This now reports:
gotype x.go 
x.go:5:23: invalid operation: shifted operand 1 (type float64) must be integer
x.go:5:15: cannot initialize x (type int) with complex(1 << s, 2) (value of type

Owner changed to @griesemer.

Status changed to Accepted.

Copy link

Comment 3:

This issue was closed by revision golang/exp@cc31dd1.

Status changed to Fixed.

zend pushed a commit to go-src/inotify that referenced this issue Apr 3, 2015
@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.
None yet

No branches or pull requests

4 participants