proposal: go/types: add TypeAndValue.IsConstant #73402
Labels
LibraryProposal
Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool
Proposal
Milestone
Proposal Details
I propose adding the following method to
go/types
:Calling
tv.IsConstant()
is clearer than writingtv.Value != nil
, and avoids confusion withtv.IsValue()
, which tests something different.Motivation: much code in x/tools uses
tv.Value != nil
, often with no explanation, making challenging code even harder to understand.The text was updated successfully, but these errors were encountered: