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

Issue 6500065: code review 6500065: reflect: add Convert (API CHANGE) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by rsc
Modified:
11 years, 7 months ago
Reviewers:
chalfant
CC:
iant, r, golang-dev
Visibility:
Public.

Description

reflect: add Type.ConvertibleTo, Value.Convert (API CHANGE) Fixes issue 4047.

Patch Set 1 #

Patch Set 2 : diff -r 292816148e44 https://go.googlecode.com/hg/ #

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

Total comments: 16

Patch Set 4 : diff -r 63f7abcae015 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 63f7abcae015 https://go.googlecode.com/hg/ #

Total comments: 5

Patch Set 6 : diff -r b4d17e91718d https://code.google.com/p/go/ #

Patch Set 7 : diff -r b4d17e91718d https://code.google.com/p/go/ #

Total comments: 1

Patch Set 8 : diff -r a5fa483d7885 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+814 lines, -4 lines) Patch
M src/pkg/reflect/all_test.go View 1 2 3 4 5 6 4 chunks +447 lines, -0 lines 0 comments Download
A src/pkg/reflect/export_test.go View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
M src/pkg/reflect/type.go View 1 2 3 4 5 6 7 3 chunks +33 lines, -4 lines 0 comments Download
M src/pkg/reflect/value.go View 1 2 3 4 5 6 7 3 chunks +318 lines, -0 lines 0 comments Download

Messages

Total messages: 14
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 7 months ago (2012-09-21 04:55:11 UTC) #1
dsymonds
Should there be a corresponding CanConvert?
11 years, 7 months ago (2012-09-21 04:56:37 UTC) #2
rsc
On Fri, Sep 21, 2012 at 12:56 AM, <dsymonds@golang.org> wrote: > Should there be a ...
11 years, 7 months ago (2012-09-21 04:56:59 UTC) #3
iant
https://codereview.appspot.com/6500065/diff/4001/src/pkg/reflect/all_test.go File src/pkg/reflect/all_test.go (right): https://codereview.appspot.com/6500065/diff/4001/src/pkg/reflect/all_test.go#newcode2383 src/pkg/reflect/all_test.go:2383: {V(float64(169)), V(float64(169))}, Is it worth testing things like int(float32(1.4))? ...
11 years, 7 months ago (2012-09-21 13:59:00 UTC) #4
rsc
(Still other comments left to process.) https://codereview.appspot.com/6500065/diff/4001/src/pkg/reflect/all_test.go File src/pkg/reflect/all_test.go (right): https://codereview.appspot.com/6500065/diff/4001/src/pkg/reflect/all_test.go#newcode2410 src/pkg/reflect/all_test.go:2410: {V(int(-1)), V(string("\uFFFD"))}, On ...
11 years, 7 months ago (2012-09-21 14:43:17 UTC) #5
rsc
PTAL https://codereview.appspot.com/6500065/diff/4001/src/pkg/reflect/value.go File src/pkg/reflect/value.go (right): https://codereview.appspot.com/6500065/diff/4001/src/pkg/reflect/value.go#newcode1995 src/pkg/reflect/value.go:1995: if dst.Kind() == Slice && dst.Name() == "" ...
11 years, 7 months ago (2012-09-21 18:39:06 UTC) #6
iant
LGTM
11 years, 7 months ago (2012-09-21 18:48:18 UTC) #7
rsc
Rob, please sign off on the API change.
11 years, 7 months ago (2012-09-21 19:10:01 UTC) #8
r
https://codereview.appspot.com/6500065/diff/13002/src/pkg/reflect/type.go File src/pkg/reflect/type.go (right): https://codereview.appspot.com/6500065/diff/13002/src/pkg/reflect/type.go#newcode1182 src/pkg/reflect/type.go:1182: return identicalUnderlyingTypes(T, V) maybe verb this. haveIdenticalUnderlyingTypes https://codereview.appspot.com/6500065/diff/13002/src/pkg/reflect/value.go File ...
11 years, 7 months ago (2012-09-21 19:24:42 UTC) #9
rsc
PTAL
11 years, 7 months ago (2012-09-22 04:58:51 UTC) #10
r
LGTM http://codereview.appspot.com/6500065/diff/5005/src/pkg/reflect/type.go File src/pkg/reflect/type.go (right): http://codereview.appspot.com/6500065/diff/5005/src/pkg/reflect/type.go#newcode1182 src/pkg/reflect/type.go:1182: return haveIdenticalUnderlyingTypes(T, V) nit: should probably be haveIdenticalUnderlyingType ...
11 years, 7 months ago (2012-09-22 06:05:34 UTC) #11
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=a1dbdb805e2e *** reflect: add Type.ConvertibleTo, Value.Convert (API CHANGE) Fixes issue 4047. R=iant, ...
11 years, 7 months ago (2012-09-22 12:52:35 UTC) #12
chalfant
On 2012/09/22 12:52:35, rsc wrote: > *** Submitted as http://code.google.com/p/go/source/detail?r=a1dbdb805e2e *** > > reflect: add ...
11 years, 7 months ago (2012-09-22 15:46:23 UTC) #13
rsc
11 years, 7 months ago (2012-09-22 16:07:46 UTC) #14
> I think you may have a typo in this panic in type.go ("AssignableTo" vs
> "ConvertibleTo"):
>
> panic("reflect: nil type passed to Type.AssignableTo")
>
> Sorry if this isn't the best way to provide you with this feedback (or
> if it is unhelpful); I'm unfamiliar with this reviewing tool.

Thanks for catching that. Email replies are great.

Russ
Sign in to reply to this message.

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