Commit Graph

216 Commits

Author SHA1 Message Date
Chris Lattner
a30ae2bf55 Merge pull request #836 from zachpanz88/new-year
Update copyright date
2015-12-31 19:36:14 -08:00
Chris Lattner
7daaa22d93 Completely reimplement/redesign the AST representation of parameters.
Parameters (to methods, initializers, accessors, subscripts, etc) have always been represented
as Pattern's (of a particular sort), stemming from an early design direction that was abandoned.
Being built on top of patterns leads to patterns being overly complicated (e.g. tuple patterns
have to have varargs and default parameters) and make working on parameter lists complicated
and error prone.  This might have been ok in 2015, but there is no way we can live like this in
2016.

Instead of using Patterns, carve out a new ParameterList and Parameter type to represent all the
parameter specific stuff.  This simplifies many things and allows a lot of simplifications.
Unfortunately, I wasn't able to do this very incrementally, so this is a huge patch.  The good
news is that it erases a ton of code, and the technical debt that went with it.  Ignoring test
suite changes, we have:
   77 files changed, 2359 insertions(+), 3221 deletions(-)

This patch also makes a bunch of wierd things dead, but I'll sweep those out in follow-on
patches.

Fixes <rdar://problem/22846558> No code completions in Foo( when Foo has error type
Fixes <rdar://problem/24026538> Slight regression in generated header, which I filed to go with 3a23d75.

Fixes an overloading bug involving default arguments and curried functions (see the diff to
Constraints/diagnostics.swift, which we now correctly accept).

Fixes cases where problems with parameters would get emitted multiple times, e.g. in the
test/Parse/subscripting.swift testcase.

The source range for ParamDecl now includes its type, which permutes some of the IDE / SourceModel tests
(for the better, I think).

Eliminates the bogus "type annotation missing in pattern" error message when a type isn't
specified for a parameter (see test/decl/func/functions.swift).

This now consistently parenthesizes argument lists in function types, which leads to many diffs in the
SILGen tests among others.

This does break the "sibling indentation" test in SourceKit/CodeFormat/indent-sibling.swift, and
I haven't been able to figure it out.  Given that this is experimental functionality anyway,
I'm just XFAILing the test for now.  i'll look at it separately from this mongo diff.
2015-12-31 19:24:46 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Max Moiseev
3fe0c60d7f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 11:00:02 -08:00
Slava Pestov
59a74b4dfe Sema: Clean up configureImplicitSelf() and related code to not return a generic parameter list, NFC
Instead, get the generic parameter list from the DeclContext,
since now we need it even if there's no 'self' type.
2015-12-15 22:59:38 -08:00
Dmitri Gribenko
feacbc4433 Rename ErrorType to ErrorProtocol 2015-12-09 17:12:19 -08:00
Xi Ge
9586337981 [Parser] Allow FuncDecl to record the locations of accessor keywords, e.g. set, get, etc. 2015-11-03 18:13:32 -08:00
Ben Langmuir
4082355244 Split KnownProtocolKind enum case from protocol name
This avoids us using reserved identifiers as the enum case names of all
our underscored protocols like _ObjectiveCBridgeable. I used the
convention PROTOCOL_WITH_NAME to mirror how the known identifiers work.

Swift SVN r32924
2015-10-27 23:10:36 +00:00
Doug Gregor
74e037657c Add notes linking the two requirement-deriving queries. NFC
Swift SVN r32375
2015-10-01 18:33:02 +00:00
Xi Ge
177f170155 Suppress a warning, NFC
Swift SVN r32227
2015-09-25 17:24:09 +00:00
Doug Gregor
373a73eb53 Map from an arbitrary requirement to a related derivable requirement.
Use this to determine whether a requirement is derivable within the
current conformance checking. Effectively NFC

Swift SVN r32190
2015-09-23 23:08:29 +00:00
Doug Gregor
fab5e741bd Unrevert "Sema: Make derived conformances work from extensions"
Update IRGen test for 32/64-bit differences.

Swift SVN r28988
2015-05-24 17:55:42 +00:00
Ted Kremenek
a575727a2b Revert "Sema: Make derived conformances work from extensions"
Speculatively revert; this looks like it is breaking the iOS bots.

Swift SVN r28963
2015-05-23 15:26:55 +00:00
Slava Pestov
9388a955dc Sema: Make derived conformances work from extensions
This is more complex than it could be if ExtensionDecl and NominalTypeDecl
had a common ancestor in the Decl hierarchy, however this is not possible
right now because TypeDecl inherits from ValueDecl.

Fixes <rdar://problem/20981254>.

Swift SVN r28941
2015-05-23 01:21:10 +00:00
Slava Pestov
1e31d0c5e0 AST: Move DerivedGlobalDecls from NominalTypeDecl to InterableDeclContext, NFC
Progress on <rdar://problem/20981254>.

Swift SVN r28931
2015-05-22 20:28:19 +00:00
Slava Pestov
14822d2bbc Sema: Put code shared by DerivedConformance*.cpp into DerivedConformances.cpp
Also remove useless conditional.

NFC

Swift SVN r28876
2015-05-21 16:07:51 +00:00