• Robert Griesemer's avatar
    spec: document that duplicate types are invalid in type switches · 3d81d4ad
    Robert Griesemer authored
    Both compilers and also go/types don't permit duplicate types in
    type switches; i.e., this spec change is documenting a status quo
    that has existed for some time.
    
    Furthermore, duplicate nils are not accepted by gccgo or go/types;
    and more recently started causing a compiler error in gc. Permitting
    them is inconsistent with the existing status quo.
    
    Rather than making it an implementation restriction (as we have for
    expression switches), this is a hard requirement since it was enforced
    from the beginning (except for duplicate nils); it is also a well
    specified requirement that does not pose a significant burden for
    an implementation.
    
    Fixes #15896.
    
    Change-Id: If12db5bafa87598b323ea84418cb05421e657dd8
    Reviewed-on: https://go-review.googlesource.com/23584Reviewed-by: 's avatarRob Pike <r@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    3d81d4ad
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...
conduct.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.html Loading commit data...
go1.5.html Loading commit data...
go1.6.html Loading commit data...
go1.7.html 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...
root.html Loading commit data...
security.html Loading commit data...
share.png Loading commit data...
tos.html Loading commit data...