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

reflect: verify/ensure that reflect supports the same string/[]byte/[]rune conversions as the spec/implementation #53523

Open
griesemer opened this issue Jun 23, 2022 · 6 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@griesemer
Copy link
Contributor

Follow-up on #23814.
See https://go-review.googlesource.com/c/go/+/412095/4/test/fixedbugs/issue23814.go for examples.

@griesemer griesemer added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 23, 2022
@griesemer griesemer added this to the Go1.20 milestone Jun 23, 2022
@dsnet
Copy link
Member

dsnet commented Jun 24, 2022

See #24746 where it is observed that reflect lets you do:

type namedByte byte
var b []namedByte
reflect.ValueOf(b).Bytes() // analogous to []byte(b), which is invalid according to the Go spec

@griesemer
Copy link
Contributor Author

griesemer commented Jun 24, 2022

@dsnet That conversion is a slice-to-slice conversion which always required that element types be identical (playground); this seems a bit different from the string->bytes/runes and bytes/runes->string conversions, which are special.

That is, I'd argue that reflect is incorrect in that case.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
@mknyszek mknyszek moved this to Triage Backlog in Go Compiler / Runtime Jul 15, 2022
@mknyszek mknyszek moved this from Triage Backlog to Todo in Go Compiler / Runtime Nov 23, 2022
@aclements
Copy link
Member

Bumping to 1.21.

@aclements aclements modified the milestones: Go1.20, Go1.21 Nov 23, 2022
@griesemer
Copy link
Contributor Author

Too late for 1.21.

@griesemer griesemer modified the milestones: Go1.21, Go1.22 Jun 6, 2023
@griesemer
Copy link
Contributor Author

We still need to do this but we've lived with this for several releases, so there's no urgency.
Bumping to 1.23.

@griesemer griesemer modified the milestones: Go1.22, Go1.23 Dec 7, 2023
@griesemer
Copy link
Contributor Author

Too late for 1.23.

@griesemer griesemer modified the milestones: Go1.23, Go1.24 Jun 5, 2024
@griesemer griesemer modified the milestones: Go1.24, Go1.25 Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

4 participants