|
|
|
Created:
11 years, 2 months ago by cmang Modified:
11 years ago Reviewers:
CC:
rsc, bradfitz, golang-codereviews Visibility:
Public. |
cmd/gc: omit non-explicit capacity in errors with map/chan make
Fixes issue 9083.
Patch Set 1 #Patch Set 2 : diff -r e45c4110ec9029d33de2293c4cad7b3bb0f26224 https://code.google.com/p/go #Patch Set 3 : diff -r e45c4110ec9029d33de2293c4cad7b3bb0f26224 https://code.google.com/p/go #Patch Set 4 : diff -r e45c4110ec9029d33de2293c4cad7b3bb0f26224 https://code.google.com/p/go #
Total messages: 7
|
cmang
Hello rsc@golang.org (cc: bradfitz@golang.org, golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
|
11 years, 2 months ago (2014年11月10日 19:43:39 UTC) #1 | |||||||||||||||||||||||
Hello rsc@golang.org (cc: bradfitz@golang.org, golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
that works? i'm a little surprised that isideal somehow distinguishes implicit from explicit. it doesn't for slices; why does it for maps and chans?
that works? i'm a little surprised that isideal somehow distinguishes implicit from explicit. it doesn't for slices; why does it for maps and chans?
there should also be a test.
On 2014年11月10日 19:47:20, rsc wrote: > that works? i'm a little surprised that isideal somehow distinguishes > implicit from explicit. > it doesn't for slices; why does it for maps and chans? isideal can distinguish because the constant 0 is made using nodintconst(0) when typechecking maps and channels. nodintconst makes a literal node with an ideal type, whereas using the numeric literal '0' or even an untyped constant integer will use defaultlit and give it type TINT. This doesn't matter for slices, because make(T) is not a valid syntax for slices.
On 2014年11月10日 19:47:37, rsc wrote: > there should also be a test. Added a test case, PTAL.
R=close To the author of this CL: The Go project has moved to Gerrit Code Review. If this CL should be continued, please see the latest version of https://golang.org/doc/contribute.html for instructions on how to set up Git and the Go project's Gerrit codereview plugin, and then create a new change with your current code. If there has been discussion on this CL, please give a link to it (golang.org/cl/173890043 is best) in the description in your new CL. Thanks very much.