aboutsummaryrefslogtreecommitdiff
path: root/test/typeparam/chans.go
AgeCommit message (Collapse)Author
2021-07-28[dev.typeparams] test/typeparam: gofmt -wMatthew Dempsky
We don't usually reformat the test directory, but all of the files in test/typeparam are syntactically valid. I suspect the misformattings here are because developers aren't re-installing gofmt with -tags=typeparams, not intentionally exercising non-standard formatting. Change-Id: I3767d480434c19225568f3c7d656dc8589197183 Reviewed-on: https://go-review.googlesource.com/c/go/+/338093 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
2021-03-15cmd/compile: add support for generic channels and type conversion during callsDan Scales
Add support for channels in subster.typ(). Add new test file chans.go. To support assignability of bidirectional channel args to directional channel params, I needed to type check generic calls after they are instantiated. (Eventually, we will create separate functions to just do the assignability logic, so we don't need to call the old typechecker in this case.) So, for generic calls, we now leave the call as OCALL (as a signal that the call still needs typechecking), and do typecheck.Call() during stenciling. Smaller changes: - Set the type of an instantiated OCLOSURE node (and not just the associated OFUNC node) - In instTypeName2, filter out the space that types2.TypeString inserts after a common in a typelist. Our standard naming requires no space after the comma. - With the assignability fix above, I no longer need the explicit conversions in cons.go. Change-Id: I148858bfc6708c0aa3f50bad7debce2b8c8c091f Reviewed-on: https://go-review.googlesource.com/c/go/+/301669 Trust: Dan Scales <danscales@google.com> Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>