Currently when call involving prefix/postfix operator is formed we
don't wrap argument in implicit parens (like we do with other calls)
when user didn't provide any explicitly, this is bad because
argument-to-parameter matcher requires multiple special cases to handle
such behavior, so let's start wrapping arguments in implicit parens instead.
Resolves: rdar://problem/40722855
Resolves: [SR-7840](https://bugs.swift.org/browse/SR-7840)
* Reject bad string interpolations
String interpolations with multiple comma-separate expressions or argument labels were being incorrectly accepted.
* Tweak error name to match message
* Diagnose empty interpolations more clearly
* Don’t double-diagnose parse errors
Fixes a test at Parse/recovery.swift:799 which the previous commit broke.
* Fix incorrect test RUN: line
A previous version of this test used FileCheck instead of -verify, and the run line wasn’t properly corrected to use -verify.
* Update comment
* Add more argument label tests
Ensures that we don’t get different results from an initializer that doesn’t exist or doesn’t take a String.
* Resolve the SR-7958 crasher test
We now diagnose the error and remove the label before it has an opportunity to crash.
LLVM r334399 (and related Clang changes) moved clang::VersionTuple to
llvm::VersionTuple. Update Swift to match.
Patch by Jason Molenda.
rdar://problem/41025046
Trying to diagnose extraneous use of `&` in parser is too early
and affects some valid cases like patterns in `case` statements,
where we still want to allow use of `&`.
Made an utility method 'consumeArgumentLabel', and use it for:
* Labels in tuple type
* Labels in tuple expression
* Argument and parameter names in parameter clause
This also fixes several issues where attribute arguments could not be
parsed as a TokenList since some of its arguments already had structure
and were not tokens
Resetting Lexer to the start of the line result re-tokenizning whole
string literal as a single token, and go past artificial EOF.
This used to end up with assertion failure or infinite-loop in
no-assertion builds.
Quick fix for: rdar://problem/36881302
The amp_prefix token is currently tolerated in any unary expression
context and then diagnosed later by Sema. This patch changes parsing to
only accept tok::amp_prefix in its allowed position: parameter lists.
This also fixes two "compiler crasher" tests.