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

cmd/compile: missing "imported and not used" error for dot-import #6428

Open
griesemer opened this issue Sep 19, 2013 · 7 comments

Comments

@griesemer
Copy link
Contributor

commented Sep 19, 2013

cat x.go
package main

import . "testing"  // declares T in file scope

type S struct {
     T int
}

func main() {
     _ = S{T: 0}
}

go tool 6g x.go produces no error. However, it should complain with:

x.go:3: imported and not used: "testing"

Note that changing the assignment in main to:

     _ = S{}

produces the expected error (actually, a slightly confused error message, see issue also
6420).
The "T" in S{T: 0} is not the same T as the one imported.
@rsc

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2013

Comment 2:

Labels changed: added release-none, removed go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2013

Comment 3:

Labels changed: added repo-main.

@gopherbot

This comment has been minimized.

Copy link

commented Oct 31, 2014

Comment 4:

CL https://golang.org/cl/162390044 mentions this issue.

@rsc rsc removed the compiler-bug label Apr 10, 2015

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

@rsc rsc changed the title cmd/gc: missing "imported and not used" error for dot-import cmd/compile: missing "imported and not used" error for dot-import Jun 8, 2015

@griesemer griesemer assigned griesemer and unassigned rsc Dec 24, 2017

@griesemer griesemer modified the milestones: Unplanned, Go1.11 Dec 24, 2017

@griesemer

This comment has been minimized.

Copy link
Contributor Author

commented Dec 24, 2017

Moving to 1.11 to make it visible.

@gopherbot

This comment has been minimized.

Copy link

commented Apr 11, 2018

Change https://golang.org/cl/106122 mentions this issue: cmd/compile: don't use packages of keys of composite literals prematurely

@griesemer

This comment has been minimized.

Copy link
Contributor Author

commented Jun 5, 2018

Not urgent.

@griesemer griesemer modified the milestones: Go1.11, Unplanned Jun 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.