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

x/tools/go/ssa/interp: allow more string conversions of byte slices #55115

Closed
timothy-king opened this issue Sep 16, 2022 · 1 comment
Closed
Assignees
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@timothy-king
Copy link
Contributor

We are probably going to accepted more kinds of conversions from byte or rune slices to strings #23536 (comment) .

interp does not currently accept such conversions:

package main

func main() {
	type MyByte byte
	type MyRune rune

	var y []MyByte
	_ = string(y)

	var z []MyRune
	_ = string(z)
}

On the above example ssa/interp will panic with the message:

Panicking: *runtime.TypeAssertionError interface conversion: types.Type is *types.Named, not *types.Basic.

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 16, 2022
@gopherbot gopherbot added this to the Unreleased milestone Sep 16, 2022
@timothy-king timothy-king self-assigned this Sep 16, 2022
@timothy-king timothy-king added Analysis Issues related to static analysis (vet, x/tools/go/analysis) NeedsFix The path to resolution is known, but the work has not been done. labels Sep 16, 2022
@gopherbot
Copy link

Change https://go.dev/cl/501301 mentions this issue: go/ssa/interp: support conversions to slices of named bytes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants