]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: review of typexpr.go
authorRobert Griesemer <gri@golang.org>
Tue, 5 Jan 2021 17:46:23 +0000 (09:46 -0800)
committerRobert Griesemer <gri@golang.org>
Wed, 6 Jan 2021 16:45:59 +0000 (16:45 +0000)
commit196102d046b2579fedc11435b541b9f9ffcac93d
tree137bc29beeaa63b115631793162cf1043430d34b
parenta8fe098a12a75801e13e99cdcc03a9d8a59c72ce
[dev.typeparams] cmd/compile/internal/types2: review of typexpr.go

This code matches go/types/typexpr but for the necessary adjustments
because of the use of package syntax rather than go/ast, and for the
code being part of cmd/compile/internal/types2 rather than go/types.

Primary differences to go.types/typexpr.go:
- syntax.FuncType doesn't carry type parameters
- type instantiations are represented using syntax.IndexExpr
  nodes
- there's an explicit syntax.SliceType
- *x is expressed as a unary operation, not a StarExpr
- grouped fields are identified by identical pointer types

To see the changes copied from recent go/types changes, compare Patchsets 1 and 2.

Change-Id: I8aa9452882d1f5e9529c52a30c7c8e65f3fcbb43
Reviewed-on: https://go-review.googlesource.com/c/go/+/281545
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/types2/typexpr.go