Commit Graph

614 Commits

Author SHA1 Message Date
Doug Gregor
f77ffad141 Check whether we have an initializer *after* building default initializers.
This is a recent regression that caused us to reject globals of
optional type that didn't have initializers <rdar://problem/16953669>.

Swift SVN r18332
2014-05-18 17:24:17 +00:00
Chris Lattner
8781e36d75 Fix <rdar://problem/16906000> Implicitly unwrapped optional let is not considered initialized, but var is
by allowing default initializing let properties.  In classes, the property
is mutable in init, and the default initialization is useful.  The benefit we
gain by banning this is outweighed by the important usecases that get closed
off by doing so.


Swift SVN r18213
2014-05-16 21:04:40 +00:00
Chris Lattner
1b3f588d95 fix <rdar://problem/16941124> Overriding property observers warn about using the property value "within its own getter"
This is a regression introduced in r18184 which cased warnings on loads from
a property in its willSet/didSet.


Swift SVN r18210
2014-05-16 20:42:50 +00:00
Chris Lattner
cf55f7edd5 fix:
<rdar://problem/16264989> property not mutable in closure inside of its willSet
and:
<rdar://problem/16826319> willSet immutability behavior is incorrect

by changing how we handle immutability of an observing property within its willSet.
Instead of trying to model it as an rvalue, just model it as an lvalue (which it is)
and diagnose the problem with a warning in MiscDiagnostics.



Swift SVN r18184
2014-05-16 06:32:33 +00:00
Chris Lattner
e383bac8f6 Rework default initialization of options to run much later, after all of the variables
have been type checked.  This allows us to reliably determine the type of the variable
and to know whether it actually needs default initialization or not.

This fixes:
<rdar://problem/16620121> Initializing constructor tries to initialize computed property overridden with willSet/didSet
which was because we were doing default initialization before computing override sets.

This does regress on one case, where our fiddly default init code isn't realizing that
a default initializer will be generated.  I fixme'd the case and filed:
<rdar://problem/16921173> implicit constructor synthesization runs too early

to track this.



Swift SVN r18094
2014-05-15 01:28:57 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Chris Lattner
b282c13c07 consolidate IBOutlet tests into one file.
Swift SVN r17943
2014-05-12 16:57:57 +00:00
Chris Lattner
4ac66214fe rework validation of IBOutlet element type checking to be recursive, fixing
a problem where we didn't allow arrays of strings as outlets.  Also, add a sema
testcase for the IBOutlet attribute.



Swift SVN r17938
2014-05-12 16:25:38 +00:00
Chris Lattner
bd636993b8 no really, add a testcase for @NSManaged sema issues.
Swift SVN r17886
2014-05-11 20:59:53 +00:00
Chris Lattner
d79646e962 parse and start type checking of @lazy attribute.
Swift SVN r17877
2014-05-11 18:37:29 +00:00
Doug Gregor
825e5be3d2 Default-initialize optional variables/properties to 'nil'.
Addresses <rdar://problem/16342813>.


Swift SVN r16222
2014-04-11 17:59:14 +00:00
Dmitri Hrybenko
571c9b3c5e Split 'type' keyword into 'static' and 'class'
rdar://15911697


Swift SVN r13908
2014-02-14 14:50:32 +00:00
Doug Gregor
7cf688123b Allow "type var" and "type func" as synonyms for "static var" and "static func".
Swift SVN r12025
2014-01-08 00:59:22 +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