• 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
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...