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: make opaqueType less annoying to use #19670

dominikh opened this issue Mar 23, 2017 · 0 comments

x/tools/go/ssa: make opaqueType less annoying to use #19670

dominikh opened this issue Mar 23, 2017 · 0 comments


Copy link

@dominikh dominikh commented Mar 23, 2017

The ssa package defines an opaqueType, which is an "opaque and degenerate" type, currently used by the Range instruction. It truly is degenerate, embedding a nil types.Type, causing a call to types.Type.Underlying to panic.

Code that wants to operate on the types of instructions needs to specifically check for the Range instruction and skip it. There doesn't seem to be a way to check for this degenerate type specifically, which would at least permit passing types around without having to keep track of the originating instruction.

The simplest solution that I can think of is to implement Underlying as the identity function. However I suspect that this hasn't been done for a good reason?

/cc @alandonovan

@dominikh dominikh added this to the Unreleased milestone Mar 23, 2017
quasilyte added a commit to quasilyte/go-contributing-ru that referenced this issue Apr 1, 2018
New tasks include:
golang/go#19675 cmd/vet: report uses of -0 in float32/64 context
golang/go#19683 cmd/compile: eliminate usages of global lineno
golang/go#19670 x/tools/go/ssa: make opaqueType less annoying to use
golang/go#19636 encoding/base64: decoding is slow
golang/go#23471 x/perf/cmd/benchstat: tips or quickstart for newcomers
golang/go#19577 test: errorcheck support for intraline errors
golang/go#19490 cmd/vet: reduce the amount of false positives for -shadow mode
golang/go#19042 cmd/internal/obj: optimize wrapper method prologue for branch prediction
golang/go#19013 cmd/compile: add tool for understanding/debugging SSA rules
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
2 participants