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: confusing internal error when importing different packages with same name from different paths #25635

griesemer opened this issue May 29, 2018 · 0 comments


Copy link

@griesemer griesemer commented May 29, 2018

This is a follow-up on #25568: It is possible to get an internal compiler error when invoking the compiler with plausible but incorrect -I arguments leading to selection of different but identically named packages ("io" in this case). To reproduce:

  1. cd $GOROOT/test
  2. go tool compile fixedbugs/bug345.dir/io.go
  3. go tool compile -I . fixedbugs/bug345.dir/main.go
fixedbugs/bug345.dir/main.go:10:2: internal compiler error: conflicting package heights 4 and 0 for path "io"

The issue here is an incorrect argument for -I. The following invocation:

go tool compile -I $HOME/test/fixedbugs/bug345.dir fixedbugs/bug345.dir/main.go

works as expected.

The internal error is confusing. We should be able to provide a better error message.

@griesemer griesemer added this to the Go1.12 milestone May 29, 2018
@odeke-em odeke-em self-assigned this Oct 18, 2018
@griesemer griesemer removed this from the Go1.12 milestone Nov 28, 2018
@griesemer griesemer added this to the Go1.13 milestone Nov 28, 2018
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants