Commit Graph

9 Commits

Author SHA1 Message Date
Chris Lattner
0619e57a61 Switch the stdlib to use #file instead of __FILE__, and deprecate the __FILE__ identifiers.
This also updates the tests that would otherwise fail.
2016-02-04 15:08:31 -08:00
Doug Gregor
b2cc34c241 Remove '#' for making parameter names into argument labels.
If you want to make the parameter and argument label the same in
places where you don't get the argument label for free (i.e., the
first parameter of a function or a parameter of a subscript),
double-up the identifier:

  func translate(dx dx: Int, dy: Int) { }

Make this a warning with Fix-Its to ease migration. Part of
rdar://problem/17218256.

Swift SVN r27715
2015-04-24 23:58:57 +00:00
Doug Gregor
793b3326af Implement the new rules for argument label defaults.
The rule changes are as follows:
  * All functions (introduced with the 'func' keyword) have argument
  labels for arguments beyond the first, by default. Methods are no
  longer special in this regard.
  * The presence of a default argument no longer implies an argument
  label.

The actual changes to the parser and printer are fairly simple; the
rest of the noise is updating the standard library, overlays, tests,
etc.

With the standard library, this change is intended to be API neutral:
I've added/removed #'s and _'s as appropriate to keep the user
interface the same. If we want to separately consider using argument
labels for more free functions now that the defaults in the language
have shifted, we can tackle that separately.

Fixes rdar://problem/17218256.

Swift SVN r27704
2015-04-24 19:03:30 +00:00
Ben Langmuir
70a93e0bfe Add code completion overload for defaulted arguments
When a call (func, method, initializer) has default arguments, produce
both the *with* and *without* default argument versions as if they were
overloaded.

rdar://problem/18573874

Swift SVN r27118
2015-04-08 02:41:20 +00:00
Denis Vnukov
152df92966 [CodeCompletion] Code Completion String getName should always return non-empty string value for
valid code completions. Code completion tests call and validate getName’s result. 

A minor fix for code completion fro subscripts.



Swift SVN r25101
2015-02-09 22:32:05 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Ben Langmuir
40e6416448 Test improvement missed in r19421
Swift SVN r19422
2014-07-01 18:54:09 +00:00
Ben Langmuir
a2aabbe575 Fix assertion failure completing anonymous default arguments
Parameters may be nameless VarDecls. Instead of asserting otherwise,
just don't provide a completion for that decl.

Swift SVN r19421
2014-07-01 18:51:23 +00:00
Dmitri Hrybenko
a83eb20500 Code completion: skip parameters that are defaulted to either of __FILE__,
__LINE__, __COLUMN__, or __FUNCTION__

rdar://16906142


Swift SVN r18746
2014-06-09 15:47:40 +00:00