spec: wording about when len(s)/cap(s) are constant doesn't match implementations #56826
Labels
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
The spec (https://go.dev/ref/spec#Length_and_capacity) says:
However, this doesn't precisely match what implementations allow.
For example, this package compiles successfully with Go 1.4 and gccgo 12.2.1, even though each len argument (syntactically) contains a channel receive and/or non-constant function call:
go/types allows declaration
c
, but rejectsd
ande
. The same applies to recent cmd/compile using types2./cc @griesemer @ianlancetaylor
The text was updated successfully, but these errors were encountered: