FAQ
Reviewers: crawshaw,

Message:
Hello [email protected] (cc: [email protected]),

I'd like you to review this change to
https://code.google.com/p/go.tools


Description:
go.tools/ssa: fixes, cleanups, cosmetic tweaks.

Fix bug: the Signature for an interface method wrapper
erroneously had a non-nil receiver.

Function:
- Set Pkg field non-nil even for wrappers.
    It is equal to that of the wrapped function.
    Only wrappers of error.Error
    (and its embeddings in other interfaces) may have nil.
    Sanity checker now asserts this.
- FullName() now uses .Synthetic field to discriminate
    synthetic methods, not Pkg==nil.
- Fullname() uses new relType() utility to print receiver type
    name unqualified if it belongs to the same package.
    (Alloc.String also uses relType utility.)

CallCommon:
- Description(): fix switch logic broken when we
    eliminated the Recv field.
- better docs.

Please review this at https://codereview.appspot.com/13057043/

Affected files:
    M ssa/func.go
    M ssa/interp/interp.go
    M ssa/lvalue.go
    M ssa/print.go
    M ssa/promote.go
    M ssa/sanity.go
    M ssa/ssa.go


--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Crawshaw at Aug 19, 2013 at 7:11 pm
    LGTM


    https://codereview.appspot.com/13057043/diff/1002/ssa/print.go
    File ssa/print.go (right):

    https://codereview.appspot.com/13057043/diff/1002/ssa/print.go#newcode40
    ssa/print.go:40: // relType is like t.String(), but if t is a Named type
    (or pointer^n
    ^n

    https://codereview.appspot.com/13057043/diff/1002/ssa/print.go#newcode49
    ssa/print.go:49: func relType(t types.Type, from *Package) string {
    This is fine for the use you have, but if it is going to be used more
    widely as your TODO suggests, I think this belongs in the types package.

    Cases like "<-chan mypkg.T" will make this function significantly more
    complex. There is also a TODO in go/types/errors.go:306 about this.
    Perhaps t.StringForPkg(pkg string).

    https://codereview.appspot.com/13057043/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Adonovan at Aug 19, 2013 at 7:32 pm

    On 2013/08/19 19:11:47, crawshaw1 wrote:
    LGTM
    https://codereview.appspot.com/13057043/diff/1002/ssa/print.go
    File ssa/print.go (right):

    https://codereview.appspot.com/13057043/diff/1002/ssa/print.go#newcode40
    ssa/print.go:40: // relType is like t.String(), but if t is a Named type (or
    pointer^n
    ^n
    It was intentional, if cryptic. Rephrased:

    // relType is like t.String(), but if t is a Named type belonging to
    // package from, optionally wrapped by one or more Pointer
    // constructors, package qualification is suppressed.


    https://codereview.appspot.com/13057043/diff/1002/ssa/print.go#newcode49
    ssa/print.go:49: func relType(t types.Type, from *Package) string {
    This is fine for the use you have, but if it is going to be used more widely as
    your TODO suggests, I think this belongs in the types package.
    Cases like "<-chan mypkg.T" will make this function significantly more complex.
    There is also a TODO in go/types/errors.go:306 about this. Perhaps
    t.StringForPkg(pkg string).
    Couldn't agree more. Added a TODO(gri).

    https://codereview.appspot.com/13057043/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Adonovan at Aug 19, 2013 at 7:38 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=b0c3f2b8db67&repo=tools ***

    go.tools/ssa: fixes, cleanups, cosmetic tweaks.

    Fix bug: the Signature for an interface method wrapper
    erroneously had a non-nil receiver.

    Function:
    - Set Pkg field non-nil even for wrappers.
        It is equal to that of the wrapped function.
        Only wrappers of error.Error
        (and its embeddings in other interfaces) may have nil.
        Sanity checker now asserts this.
    - FullName() now uses .Synthetic field to discriminate
        synthetic methods, not Pkg==nil.
    - Fullname() uses new relType() utility to print receiver type
        name unqualified if it belongs to the same package.
        (Alloc.String also uses relType utility.)

    CallCommon:
    - Description(): fix switch logic broken when we
        eliminated the Recv field.
    - better docs.

    R=david.crawshaw, crawshaw, gri
    CC=golang-dev
    https://codereview.appspot.com/13057043


    https://codereview.appspot.com/13057043/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedAug 16, '13 at 4:27p
activeAug 19, '13 at 7:38p
posts4
users2
websitegolang.org

2 users in discussion

Adonovan: 3 posts Crawshaw: 1 post

People

Translate

site design / logo © 2023 Grokbase