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

Closed
griesemer opened this issue Feb 13, 2018 · 4 comments
Closed

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

griesemer opened this issue Feb 13, 2018 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

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 griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 13, 2018
@griesemer griesemer added this to the Go1.11 milestone Feb 13, 2018
@griesemer griesemer assigned griesemer and unassigned mdempsky Jun 5, 2018
@griesemer
Copy link
Contributor Author

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

@griesemer griesemer modified the milestones: Go1.11, Go1.12 Jun 5, 2018
@odeke-em odeke-em self-assigned this Oct 18, 2018
@griesemer
Copy link
Contributor Author

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

@griesemer griesemer modified the milestones: Go1.12, Go1.13 Nov 28, 2018
@griesemer griesemer modified the milestones: Go1.13, Go1.14 May 6, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@dominikh
Copy link
Member

The error has gotten worse:

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

@griesemer
Copy link
Contributor Author

This is now working without error in Go 1.18. Closing.

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants