Previously, builtin operators followed by comment block were tokenized as
normal operators (e.g. tok::oper_binary_spaced) instead of dedicated
token(e.g. tok::equal).
That used to cause strange parse errors:
test.swift:1:3: error: use of unresolved operator '='
_ =/* */2
^
along with recent policy changes:
- For expression types that are not specifically handled, make sure to
produce a general "unused value" warning, catching a bunch of unused
values in the testsuite.
- For unused operator results, diagnose them as uses of the operator
instead of "calls".
- For calls, mutter the type of the result for greater specificity.
- For initializers, mutter the type of the initialized value.
- Look through OpenExistentialExpr's so we can handle protocol member
references propertly.
- Look through several other expressions so we handle @discardableResult
better.
Previously, comments were treated as non-whitespace. Operators
also checked for right-boundedness before detecting comments
which start in the middle of an operator.
This resolves both of these issues so that comments are
consistently treated as whitespace when determining whether
operators are left- or right-bound.
Fixes SR-186 and SR-960 (SE-0037)