Commit Graph

8 Commits

Author SHA1 Message Date
Max Moiseev
1814e4fce3 Fixing tests 2017-01-23 10:59:31 -08:00
Jacob Bandes-Storch
4a16880103 [QoI] Add diagnostic for unused literal values
Fixes SR-3522.
2017-01-10 20:42:36 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Rintaro Ishizaki
9d1a3fc62c [Lexer] Trim comments off operator-identifier before tokenize
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
    ^
2016-10-22 23:32:13 +09:00
Chris Lattner
3549ec5404 [QoI] make several improvements to the unused expression diagnostics, to go
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.
2016-05-16 23:26:07 -07:00
Trent Nadeau
0cc851568a Updated tests to use @discardableResult and _ = . 2016-05-11 22:53:38 -04:00
Jesse Rusak
51ded13bce [Lexer] Updates to operator-whitespace handling from code review 2016-04-02 17:38:42 -04:00
Jesse Rusak
83b4c47222 [Lexer] Treat comments as whitespace for operator arity rules.
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)
2016-03-18 11:51:27 -04:00