Commit Graph

14 Commits

Author SHA1 Message Date
Robert Widmann
547e0a4ebe Migrate Serialization tests to swift 4 2018-06-27 12:55:22 -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
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
Maxim Moiseev
0e54467bfa Final bulk removal of Type suffix 2015-12-16 17:06:19 -08:00
Slava Pestov
d1c33b9fd0 AST: Tighten up AbstractStorageDecl::isSettable()
'let' properties are settable inside certain initializers, but the
logic was wrong -- in most cases we would fall through and return
true from ::isSettable().

This came up when deserialization (correctly) didn't set the setter
accessibility on a 'let' property, and a read of that property from
a constructor in another struct incorrectly decided the property
was settable, causing a crash.

Fixes <rdar://problem/21559246>.

Swift SVN r30484
2015-07-22 01:14:32 +00:00
Jordan Rose
2f83732a5a Static lets are never mutable.
Also, assert that we're not misusing isSetterAccessibleFrom, which was masking
this issue.

rdar://problem/20193168

Swift SVN r29461
2015-06-17 22:36:02 +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
Doug Gregor
ae23d3c4f7 Remove all test dependencies on __conversion.
Swift SVN r19812
2014-07-10 16:58:42 +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
44cde3ae0a [serialization] Serialize DeclContexts, VarDecls, and StructTypes.
Unlike Clang, Swift's DeclContexts are not all Decls. However, I believe
each DeclContext that is /serialized/ will be either a decl, a
TranslationUnit, or a FuncExpr for a function with an actual declaration.
This might turn out to be wrong if (a) SIL needs proper DeclContexts for
variables in function bodies, or (b) we need to serialize anonymous
closure default arguments.

Along with an extension of the ConstructorDecl placeholder code, this allows
us to round-trip empty structs.

Swift SVN r5532
2013-06-08 00:18:24 +00:00