Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(249)

Issue 108230044: go.tools/go/types: type the append([]byte, string...) b...

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by pcc
Modified:
11 years, 1 month ago
Reviewers:
gri, adonovan
CC:
golang-codereviews
Visibility:
Public.

Description

go.tools/go/types: type the append([]byte, string...) builtin more correctly This builtin is a little weird in this form as it is (to my knowledge) the only function that takes a variadic argument of non-slice type. The language provides no syntax to express this, so we pick a stringification for such arguments that does not appear in the language. Specifically, use T... instead of ...T to distinguish it from the normal case where the type is a slice. This change lets the go/ssa package produce more efficient IR by avoiding an extra conversion of the second argument.

Patch Set 1 #

Patch Set 2 : diff -r c1516b52ea3b https://code.google.com/p/go.tools #

Patch Set 3 : diff -r c1516b52ea3b https://code.google.com/p/go.tools #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -8 lines) Patch
M go/types/builtins.go View 1 1 chunk +1 line, -1 line 0 comments Download
M go/types/builtins_test.go View 1 2 1 chunk +3 lines, -5 lines 0 comments Download
M go/types/typestring.go View 1 1 chunk +8 lines, -2 lines 2 comments Download

Messages

Total messages: 7
pcc
11 years, 4 months ago (2014-06-27 22:12:35 UTC) #1
gri
LGTM Can you explain in the CL desc which problem this solves? Presumably you need ...
11 years, 4 months ago (2014-06-27 22:45:43 UTC) #2
pcc
On 2014/06/27 22:45:43, gri wrote: > LGTM > > Can you explain in the CL ...
11 years, 4 months ago (2014-06-27 22:54:31 UTC) #3
gri
LGTM
11 years, 4 months ago (2014-06-27 23:00:42 UTC) #4
gri
*** Submitted as https://code.google.com/p/go/source/detail?r=5e316c800d33&repo=tools *** go.tools/go/types: type the append([]byte, string...) builtin more correctly This builtin ...
11 years, 4 months ago (2014-06-27 23:00:58 UTC) #5
adonovan
https://codereview.appspot.com/108230044/diff/40001/go/types/typestring.go File go/types/typestring.go (right): https://codereview.appspot.com/108230044/diff/40001/go/types/typestring.go#newcode224 go/types/typestring.go:224: writeType(buf, this, typ, visited) A comment would be good ...
11 years, 4 months ago (2014-06-29 11:08:28 UTC) #6
gri
11 years, 1 month ago (2014-09-13 00:29:25 UTC) #7
https://codereview.appspot.com/108230044/diff/40001/go/types/typestring.go File go/types/typestring.go (right): https://codereview.appspot.com/108230044/diff/40001/go/types/typestring.go#ne... go/types/typestring.go:224: writeType(buf, this, typ, visited) On 2014/06/29 11:08:28, adonovan wrote: > A comment would be good here. > > Also, please update the Signature type docstring to mention that isvariadic > implies either that the last param type is an unnamed slice type OR a string (in > the special case of the append builtin). Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b