• Robert Griesemer's avatar
    spec: clarify variable declaration type rules · 47094dcf
    Robert Griesemer authored
    Not a language change.
    
    Several inaccuracies were fixed:
    
    1) A variable declaration may declare more than just one
    variable.
    
    2) Variable initialization follows the rules of assignments,
    including n:1 assignments. The existing wording implied a 1:1
    or n:n rule and generally was somewhat unspecific.
    
    3) The rules for variable declarations with no types and
    untyped initialization expressions had minor holes (issue 8088).
    
    4) Clarified the special cases of assignments of untyped values
    (we don't just have untyped constants, but also untyped bools,
    e.g. from comparisons). The new wording is more direct.
    
    To that end, introduced the notion of an untyped constant's
    "default type" so that the same concept doesn't have to be
    repeatedly introduced.
    
    Fixes #8088.
    
    LGTM=iant, r, rsc
    R=r, rsc, iant, ken
    CC=golang-codereviews
    https://golang.org/cl/142320043
    47094dcf
Name
Last commit
Last update
..
articles Loading commit data...
codewalk Loading commit data...
devel Loading commit data...
gopher Loading commit data...
play Loading commit data...
progs Loading commit data...
asm.html Loading commit data...
cmd.html Loading commit data...
code.html Loading commit data...
contrib.html Loading commit data...
contribute.html Loading commit data...
debugging_with_gdb.html Loading commit data...
docs.html Loading commit data...
effective_go.html Loading commit data...
gccgo_contribute.html Loading commit data...
gccgo_install.html Loading commit data...
go-logo-black.png Loading commit data...
go-logo-blue.png Loading commit data...
go-logo-white.png Loading commit data...
go1.1.html Loading commit data...
go1.2.html Loading commit data...
go1.3.html Loading commit data...
go1.4.txt Loading commit data...
go1.html Loading commit data...
go1compat.html Loading commit data...
go_faq.html Loading commit data...
go_mem.html Loading commit data...
go_spec.html Loading commit data...
help.html Loading commit data...
ie.css Loading commit data...
install-source.html Loading commit data...
install.html Loading commit data...
logo-153x55.png Loading commit data...
root.html Loading commit data...
share.png Loading commit data...
sieve.gif Loading commit data...
tos.html Loading commit data...