compiler: lower expression types in lowering pass

Ensure that array types with complicated length expressions are
handled correctly by lowering expression types in the lowering pass.

This required some adjustment of constant expression types to not
report too many errors for circular constant expressions.  We now
record error types in the Named_constant type.  If we find the
circularity due to lowering the Named_constant, we use that location
for the error message; this retains the error location we used to use.

Fixes golang/go#23545

Change-Id: I7cdb1cea416e3af24fe169f7707424bfcf239df1
Reviewed-on: https://go-review.googlesource.com/91035
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 files changed