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: better error message for failed string conversion #23813

Open
griesemer opened this issue Feb 13, 2018 · 3 comments
Open

cmd/compile: better error message for failed string conversion #23813

griesemer opened this issue Feb 13, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@griesemer
Copy link
Contributor

@griesemer griesemer commented Feb 13, 2018

https://play.golang.org/p/8ADwHokqcK5 complains with:

prog.go:6:12: cannot use x (type []T) as type []byte in argument to runtime.slicebytetostring

The error message should not mention runtime.slicebytetostring which is an implementation detail.

(There are probably more error situations that expose runtime calls this way. Should handle them all uniformly.)

@griesemer
Copy link
Contributor Author

@griesemer griesemer commented Jun 5, 2018

Has been like this for a while. Moving to 1.12.

Loading

@griesemer griesemer removed this from the Go1.11 milestone Jun 5, 2018
@griesemer griesemer added this to the Go1.12 milestone Jun 5, 2018
@odeke-em odeke-em self-assigned this Oct 18, 2018
@griesemer
Copy link
Contributor Author

@griesemer griesemer commented Oct 24, 2018

We should wait with fixing this depending on the resolution of #23536. It's not just go/types. The compiler also seems not consistent.

Loading

@griesemer griesemer removed this from the Go1.12 milestone Nov 28, 2018
@griesemer griesemer added this to the Go1.13 milestone Nov 28, 2018
@griesemer griesemer removed this from the Go1.13 milestone May 6, 2019
@griesemer griesemer added this to the Go1.14 milestone May 6, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
@dominikh
Copy link
Member

@dominikh dominikh commented Dec 30, 2020

The error has gotten worse:

./prog.go:6:12: cannot use <node SPTR> (type *T) as type *byte in argument to runtime.slicebytetostring

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants