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

go/types: constant values should reported as machine values for concrete types #8718

Open
griesemer opened this issue Sep 13, 2014 · 4 comments
Milestone

Comments

@griesemer
Copy link
Contributor

Feature request: The reported values of constants should be the respective machine
values (perhaps in addition to the precise values) if the constant type is not an
untyped type.
@griesemer griesemer self-assigned this Sep 13, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title go.tools/go/types: constant values should reported as machine values for concrete types x/tools/go/types: constant values should reported as machine values for concrete types Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@griesemer griesemer changed the title x/tools/go/types: constant values should reported as machine values for concrete types go/types: constant values should reported as machine values for concrete types Jul 31, 2015
@griesemer griesemer modified the milestones: Go1.6, Unreleased Aug 24, 2015
@griesemer
Copy link
Contributor Author

Proposal:

// TypeAndValue reports the type and value (for constants)
// of the corresponding expression. If the constant is used in
// an expression at run time (for instance in an assignment),
// GoValue contains the corresponding machine (materialized)
// value. The type of GoValue is the underlying type of the
// constant (a Go basic type permissible as constant type).
type TypeAndValue struct {
    mode  operandMode
    Type  Type
    Value constant.Value
    GoValue interface{}
}

@rsc
Copy link
Contributor

rsc commented Nov 30, 2015

Too late for Go 1.6.

@rsc rsc modified the milestones: Unplanned, Go1.6 Nov 30, 2015
@griesemer griesemer modified the milestones: Go1.9Maybe, Unplanned Feb 25, 2017
@griesemer griesemer modified the milestones: Go1.10, Go1.9Maybe May 9, 2017
@griesemer
Copy link
Contributor Author

Nice to have. Not for 1.10.

@griesemer griesemer modified the milestones: Go1.10, Go1.11 Oct 26, 2017
@griesemer griesemer modified the milestones: Go1.11, Go1.12 Apr 11, 2018
@griesemer
Copy link
Contributor Author

Not urgent. Moving to 1.12.

@griesemer griesemer removed this from the Go1.12 milestone Oct 11, 2018
@griesemer griesemer added this to the Unplanned milestone Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants