compiler: improve type handling for string concat ops on constants

Resolve a small problem with concatenation of string constants: in a
string concat X + Y where X has named type and Y has abstract string
type, insure that the result has X's type, and disable folding if the
both sides have a concrete type that does not match.

Fixes golang/go#31412.

Change-Id: I6db2e9e786a5943f9580a166bfd0cb33811ad6b3
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/171797
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2 files changed