• Robert Griesemer's avatar
    go/types: update operand types early · 5183bfda
    Robert Griesemer authored
    For expressions where the result type is independent
    of the argument types (comparisons, conversions, rhs
    of shifts), set the final expression types for those
    subtrees early.
    
    This fixes several bugs where incorrect lhs shift
    operands where used (say in a comparison), but were
    not reported.
    
    Together with the changes listed below this CL fixes
    many type-checker bugs.
    
    Also:
    - better documented updateExprType
    - added larger comment to expr.go explaining
      the basic expression checking algorithm
    - use latest definition for indices and make
      arguments; use the same code to check both
    - use the same mechanism for cycle detection
      in constant expressions as for variables
      (new field Constant.visited)
    - more tests for complex and make builtins
    - many more and systematic tests for shifts;
      moved them into separate testfile
    - in the testing code, don't compare the
      expected error pattern against itself
      (the actual message was always ignored...)
    - fix affected error patterns in the test files
    - various cleanups along the way
    
    R=adonovan
    CC=golang-dev
    https://golang.org/cl/7432051
    5183bfda
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...