]> Cypherpunks repositories - gostls13.git/commit
go/constant: add Val accessor and Make constructor to handle varied types
authorRebecca Stambler <rstambler@golang.org>
Wed, 27 Feb 2019 19:10:07 +0000 (14:10 -0500)
committerRebecca Stambler <rstambler@golang.org>
Wed, 6 Mar 2019 23:36:59 +0000 (23:36 +0000)
commite269f4ce01c458b53975fe666261b4be13160773
treef4e6fa06da7c3e9ff8527f420c81a93234e38a33
parent4d8a37a6d98e9524300ce669affa3f820965bc41
go/constant: add Val accessor and Make constructor to handle varied types

This change adds a Val accessor that returns the underlying type for a
given constant.Value. This change also adds a Make constructor that builds a
constant.Value given a value of a specific type.

Fixes #29820

Change-Id: I4fc3f5221408e24af42ffecd21ce4099ee75b47a
Reviewed-on: https://go-review.googlesource.com/c/go/+/164538
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/constant/example_test.go
src/go/constant/value.go
src/go/constant/value_test.go