Commit Graph

21 Commits

Author SHA1 Message Date
Brian King
29c1fc472b Generate an error message on protocol extensions with the final attribute. 2017-03-09 14:18:39 -05:00
Doug Gregor
eb3ba78d94 Remove the swift3_migration attribute.
This attribute was a (my) bad idea that we ended up not using. Kill it.
2016-08-19 14:04:06 -07:00
John McCall
afdda3d107 Implement SE-0117.
One minor revision: this lifts the proposed restriction against
overriding a non-open method with an open one.  On reflection,
that was inconsistent with the existing rule permitting non-public
methods to be overridden with public ones.  The restriction on
subclassing a non-open class with an open class remains, and is
in fact consistent with the existing access rule.
2016-08-02 07:46:38 -07:00
Joe
a6dad0091b [SE-0095] Initial parsing implementation for '&' composition syntax
This commit defines the ‘Any’ keyword, implements parsing for composing
types with an infix ‘&’, and provides a fixit to convert ‘protocol<>’

- Updated tests & stdlib for new composition syntax
- Provide errors when compositions used in inheritance.
Any is treated as a contextual keyword. The name ‘Any’
is used emit the empty composition type. We have to
stop user declaring top level types spelled ‘Any’ too.
2016-07-19 12:01:02 -07:00
Jorge Bernal
0a3f913b20 SE-0070: Make Optional Requirements Objective-C-only.
Optional protocol requirements now require an explicit @objc attribute.

Fixes SR-1395
2016-05-06 11:05:52 +02:00
Chris Lattner
f51fcdbbb6 stop using deprecated constructs. 2016-04-17 10:20:12 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
gregomni
78216b2990 Change all remaining tests that use typealias in a protocol to use associatedtype. 2016-03-09 18:08:52 -08:00
Doug Gregor
4ce77cb39f Deserialize swift3_migration attribute with an empty "renamed" string. 2016-01-14 16:37:25 -08:00
Doug Gregor
67c81154af Add a swift3_migration attribute to describe how an API gets migrated.
Introduce a new attribute, swift3_migration, that lets us describe the
transformation required to map a Swift 2.x API into its Swift 3
equivalent. The only transformation understood now is "renamed" (to
some other declaration name), but there's a message field where we can
record information about other changes. The attribute can grow
somewhat (e.g., to represent parameter reordering) as we need it.

Right now, we do nothing but store and validate this attribute.
2016-01-13 16:53:01 -08:00
Doug Gregor
f2e66d1cd7 Break recursion when deserializing constrained protocol extensions.
When reading the generic parameters of a constrained protocol
extension, cross-refencing an associated type would perform name
lookup into the protocol extension itself, causing fatal recursion
during deserialization. Fixed by avoiding additional deserialization
when looking for an associated type. Fixes rdar://problem/20812303.

Swift SVN r28228
2015-05-06 23:56:58 +00:00
Doug Gregor
10934bb273 Start requiring 'final' on members of protocol extensions.
Part of rdar://problem/11735843.

Swift SVN r26941
2015-04-03 18:09:24 +00:00
Doug Gregor
e519eb3059 Add a simple test for (de-)serialization of protocol extensions.
Swift SVN r26772
2015-03-31 18:56:05 +00:00
Doug Gregor
5fc8ac7fd1 Require the 'override' keyword for initializers that override designated initializers.
Swift SVN r20490
2014-07-24 15:38:33 +00:00
Doug Gregor
a5c079af59 Replace the class_protocol attribute with a "class" requirement.
This only tackles the protocol case (<rdar://problem/17510790>); it
does not yet generalize to an arbitrary "class" requirement on either
existentials or generics.

Swift SVN r19896
2014-07-13 06:57:48 +00:00
Chris Lattner
fe95f81397 introduce a new 'DeclModifier' flag on attributes, which mark that the
attribute is a "modifier" of a decl, not an "attribute" and thus shouldn't
be spelt with an @ sign.  Teach the parser to parse "@foo" but reject it with
a nice diagnostic and a fixit if "foo" is a decl modifier.

Move 'dynamic' over to this (since it simplifies some code), and switch the
@optional and @required attributes to be declmodifiers (eliminating their @'s).



Swift SVN r19787
2014-07-10 05:49:10 +00:00
Jordan Rose
ac90133b8c Update tests for accessibility modifiers becoming context-sensitive keywords.
Swift SVN r19673
2014-07-08 02:17:49 +00:00
Jordan Rose
e9f6fba434 Update tests for memberwise accessibility.
Swift SVN r19354
2014-06-30 18:50:51 +00:00
Jordan Rose
5557c3972b Update tests for accessibility.
In most cases this means adding @public to things that get serialized;
in a few cases it means using a modern public stdlib API instead of
a legacy thing I was trying to keep @internal.

Swift SVN r19350
2014-06-30 18:50:40 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Jordan Rose
9a67bc597e [serialization] Add support for classes.
Classes are exactly like structs except that they may have a base class.
However, this type will show up in the inheritance list. That means we
don't actually need to serialize it twice; we can just grab the base class
from the inheritance list.

Swift SVN r6133
2013-07-10 23:25:34 +00:00