Change information
Commit message:
go/types: fix inNode debug assertion for "for range x {}"
For a RangeStmt with no range variables, s.TokPos is invalid (NoPos).
The inNode debug assertion (start <= pos && pos < end) fails on the
zero pos. The position is unused in that case (noNewVarPos is only
read when isDef is true), but inNode still asserts.
Use s.For as a fallback so the assertion holds. types2 is unaffected
because syntax.ForStmt does not have this shape.
Found while running go/types tests with debug=true.Change-Id: I82ebffca98bc9f41cda4364d31d0845bac97b5ae
Change size: XS
Delta: 1 file changed, 7 insertions(+), 1 deletion(-)
Branch: refs/heads/master