Commit Graph

14 Commits

Author SHA1 Message Date
Hamish Knight
e5952ab7fe Fix a couple of invalid location diagnostics 2020-03-23 09:17:58 -07:00
Hamish Knight
f3708b29ec Add tests for operator lookup and redeclaration checking 2020-03-23 09:17:58 -07:00
Chris Lattner
7572081608 change a directory with one file in it to be one file.
Swift SVN r21048
2014-08-05 22:46:11 +00:00
Chris Lattner
3ad9c58c18 Disallow (with a nice fixit) the infix modifier on func decls, it is just validated
and ignored anyway.  It is still required on operator decls though.


Swift SVN r19978
2014-07-15 16:52:04 +00:00
Jordan Rose
10815eb5f9 s/attribute/modifier/ in a number of diagnostics.
Swift SVN r19972
2014-07-15 04:57:04 +00:00
Chris Lattner
e0b0205cd7 Remove the @assignment attribute entirely. It doesn't do anything except
enforce its own little constraints.  The type checker isn't using it for
anything, and it is just clutter.

This resolves <rdar://problem/16656024> Remove @assignment from operator implementations



Swift SVN r19960
2014-07-14 22:44:25 +00:00
Chris Lattner
540203041e implement <rdar://problem/14607026> Restrict use of '<' and '>' as prefix/postfix operator names
Swift SVN r19947
2014-07-14 21:12:42 +00:00
Chris Lattner
5f55052e89 pull operator decls into the attribute flow: have the parser attach attributes
to operator decls, and validate the attributes in the type checker.  This allows
us to reject invalid operator decls (resolving a fixme) and restores syntax coloring
of 'infix' on an operator (a regression in my last patch).



Swift SVN r19932
2014-07-14 17:03:41 +00:00
Chris Lattner
57cd2506ff Change "operator infix" to "infix operator" for consistency with the rest of the declaration
modifiers and with the func implementations of the operators.  This resolves the rest of:
<rdar://problem/17527000> change operator declarations from "operator prefix" to "prefix operator" & make operator a keyword




Swift SVN r19931
2014-07-14 16:39:10 +00:00
Chris Lattner
8991456ff2 Switch infix/postfix/prefix to be declaration modifiers instead of attributes,
eliminating the @'s from them when used on func's.  This is progress towards
<rdar://problem/17527000> change operator declarations from "operator prefix" to "prefix operator" & make operator a keyword

This also consolidates rejection of custom operator definitions into one
place and makes it consistent, and adds postfix "?" to the list of rejected
operators.

This also changes the demangler to demangle weak/inout/postfix and related things
without the @.



Swift SVN r19929
2014-07-14 15:51:49 +00:00
Chris Lattner
ac6cd1490c move operator attributes off of validateAttribute onto the nicer AttributeChecker
Swift SVN r19928
2014-07-14 15:06:34 +00:00
Jim Ingham
bc6951d288 Followup to r19830: preserve the original token so we report the
correct location for the operator error, and added a test for the
error reporting for operators in non-global scopes.


Swift SVN r19862
2014-07-11 23:12:39 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Doug Gregor
faf1c45d14 Shuffle the files in the testsuite a bit to try to reflect language structure.
There's a lot more work to do here, but start to categorize tests
along the lines of what a specification might look like, with
directories (chapters) for basic concepts, declarations, expressions,
statements, etc.


Swift SVN r9958
2013-11-05 15:12:57 +00:00