]> Cypherpunks repositories - gostls13.git/commit
spec: clarify what is considered a function call for len/cap special case
authorRobert Griesemer <gri@golang.org>
Tue, 4 Mar 2014 04:07:34 +0000 (20:07 -0800)
committerRobert Griesemer <gri@golang.org>
Tue, 4 Mar 2014 04:07:34 +0000 (20:07 -0800)
commit871698136d7a6452267b90e06d7cab4fc1f7cfea
tree2bee88c08cc05a2d50b235afb6f2083c1105ad27
parent709b12ffe63b6f13a344286f9ff6afed7c283887
spec: clarify what is considered a function call for len/cap special case

gccgo considers built-in function calls returning a constant not as function call (issue 7386)
go/types considers any call (regular or built-in) as a function call

The wording and examples clarify that only "function calls" that are issued
at run-time (and thus do not result in a constant result) are considered
function calls in this case.

gc is inconsistent (issue 7385)
gccgo already interprets the spec accordingly and issue 7386 is moot.
go/types considers all calls (constant or not) as function calls (issue 7457).

Fixes #7387.
Fixes #7386.

LGTM=r, rsc, iant
R=r, rsc, iant, ken
CC=golang-codereviews
https://golang.org/cl/66860046
doc/go_spec.html