mirror of
https://github.com/golang/go
synced 2024-11-21 19:04:44 -07:00
07cc6440dc
Background: The current spec is imprecise with respect to the parsing ambiguity for composite literals: It says that the ambiguity arises when the TypeName form of the LiteralType is used. The following code: if (B) {} ... is not using the TypeName form (but the parenthesized TypeName form) and thus could be interpreted as: if ((B){}) ... instead of if B {} ... Both compilers and gofmt choose the latter interpretation. One could fix the spec by making the clause regarding the parsing ambiguity more precise ("...using the _possibly parenthesized_ TypeName form of the LiteralType..."). The alternative (chosen here) is to simply disallow parenthesized literal types. Except for a single test case (test/parentype.go) there appears to be no Go code under $GOROOT containing parenthesized literal types. Furthermore, parentheses are never needed around a literal type for correct parsing. R=golang-dev CC=golang-dev https://golang.org/cl/1913041 |
||
---|---|---|
.. | ||
codelab/wiki | ||
codewalk | ||
devel | ||
gopher | ||
progs | ||
talks | ||
code.html | ||
codereview_with_mq.html | ||
contribute.html | ||
effective_go.html | ||
gccgo_contribute.html | ||
gccgo_install.html | ||
go_faq.html | ||
go_for_cpp_programmers.html | ||
go_lang_faq.html | ||
go_learning.html | ||
go_mem.html | ||
go_programming_faq.html | ||
go_spec.html | ||
go_tutorial.html | ||
go_tutorial.txt | ||
go-logo-black.png | ||
go-logo-blue.png | ||
go-logo-white.png | ||
GoCourseDay1.pdf | ||
GoCourseDay2.pdf | ||
GoCourseDay3.pdf | ||
godocs.js | ||
htmlgen.go | ||
install.html | ||
logo-153x55.png | ||
Makefile | ||
makehtml | ||
popups.js | ||
prog.sh | ||
root.html | ||
sieve.gif | ||
style.css | ||
video-snap-fastcompiles.jpg | ||
video-snap-gocoding.jpg | ||
video-snap-io.jpg | ||
video-snap-oscon.jpg |