]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] go/*: add TODOs from CLs importing dev.go2go changes
authorRob Findley <rfindley@google.com>
Tue, 8 Dec 2020 20:01:32 +0000 (15:01 -0500)
committerRobert Findley <rfindley@google.com>
Tue, 8 Dec 2020 22:00:26 +0000 (22:00 +0000)
With the plurality of CLs importing dev.go2go changes it's getting hard
to track all of the code review comments that were deferred for later
consideration. Add some TODOs to capture these comments in the source,
so that they may be more easily located.

Change-Id: I5caf085fec11ca8992b7affe6feb0a7aa202f21f
Reviewed-on: https://go-review.googlesource.com/c/go/+/276254
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/ast/ast.go
src/go/parser/parser.go
src/go/types/typestring.go

index 8195ec022f984516c4de20c5fa33094f6e2fa2b7..2456020c5ef336681a01317b5dbe02660b2240cf 100644 (file)
@@ -372,7 +372,9 @@ type (
                Args     []Expr    // function arguments; or nil
                Ellipsis token.Pos // position of "..." (token.NoPos if there is no "...")
                Rparen   token.Pos // position of ")"
-               Brackets bool      // if set, "[" and "]" are used instead of "(" and ")"
+               // TODO(rFindley) use a new ListExpr type rather than overloading CallExpr
+               //                via Brackets, as is done in the syntax package
+               Brackets bool // if set, "[" and "]" are used instead of "(" and ")"
        }
 
        // A StarExpr node represents an expression of the form "*" Expression.
@@ -987,6 +989,8 @@ type (
                Name *Ident        // function/method name
                Type *FuncType     // function signature: type and value parameters, results, and position of "func" keyword
                Body *BlockStmt    // function body; or nil for external (non-Go) function
+               // TODO(rFindley) consider storing TParams here, rather than FuncType, as
+               //                they are only valid for declared functions
        }
 )
 
index 9c414c411e085a3f084e9a7277471ea8ab0a8573..24e84d5103a7aea8cc141a1206aefcb63832993d 100644 (file)
@@ -798,7 +798,7 @@ func (p *parser) parseFieldDecl(scope *ast.Scope) *ast.Field {
        } else {
                // embedded, possibly generic type
                // (using the enclosing parentheses to distinguish it from a named field declaration)
-               // TODO(gri) confirm that this doesn't allow parenthesized embedded type
+               // TODO(rFindley) confirm that this doesn't allow parenthesized embedded type
                typ = p.parseType()
        }
 
@@ -870,6 +870,7 @@ type field struct {
 }
 
 func (p *parser) parseParamDecl(name *ast.Ident) (f field) {
+       // TODO(rFindley) compare with parser.paramDeclOrNil in the syntax package
        if p.trace {
                defer un(trace(p, "ParamDeclOrNil"))
        }
index c82fa3395b83036f9dbb02677e8dd7ce80c001b5..b9c227d4602e06c8da32d9c6656e664dfc9bb417 100644 (file)
@@ -313,6 +313,7 @@ func writeTypeList(buf *bytes.Buffer, list []Type, qf Qualifier, visited []Type)
 }
 
 func writeTParamList(buf *bytes.Buffer, list []*TypeName, qf Qualifier, visited []Type) {
+       // TODO(rFindley) compare this with the corresponding implementation in types2
        buf.WriteString("[")
        var prev Type
        for i, p := range list {