compiler: parenthesize channel type strings if necessary
authorIan Lance Taylor <iant@golang.org>
Thu, 24 Dec 2020 00:32:30 +0000 (16:32 -0800)
committerIan Lance Taylor <iant@golang.org>
Thu, 24 Dec 2020 01:50:31 +0000 (17:50 -0800)
commit085fd2a46e512638a4d7a96e07eaf3b8b021a567
tree58395ab15b5f609c411312db2bd6701d1fa08cf3
parent85d8ebcfc235e71bf52e7bf1d3864e1b95689091
compiler: parenthesize channel type strings if necessary

Avoid the ambiguity between "chan <- (chan int)" and "chan (<- chan int)".
This parenthesizes the same way as the gc compiler.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/279961
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc