go/types: fix type-checking of shift expressions
Completely rethought shift expression type checking. Instead of attempting to type-check them eagerly, now delay the checking of untyped constant lhs in non- constant shifts until the final expression type becomes clear. Once it is clear, update the respective expression tree with the final (not untyped) type and check respective shift lhs' where necessary. This also cleans up another conundrum: How to report the type of untyped constants as it changes from untyped to typed. Now, Context.Expr is only called for an expresion x once x has received its final (not untyped) type (for constant initializers, the final type may still be untyped). With this CL all remaining std lib packages that did not typecheck due to shift errors pass now. TODO: There's a lot of residual stuff that needs to be cleaned up but with this CL all tests pass now. R=adonovan, axwalk CC=golang-dev https://golang.org/cl/7381052
Showing
This diff is collapsed.
Please
register
or
sign in
to comment