Commit Graph

28 Commits

Author SHA1 Message Date
Mykola Pokhylets
89f8f8b9bf Wrap only changes related to the closure frontend logic 2025-08-02 20:24:46 +02:00
Mykola Pokhylets
ae48446716 Wrap SE-0481 into an upcoming feature until source incompatibilities are resolved 2025-08-02 20:24:21 +02:00
Mykola Pokhylets
3e0de8672a Removed the feature and made changes unconditional 2025-05-15 10:52:09 +02:00
Mykola Pokhylets
5a69c8ebdb Added REQUIRES: swift_feature_WeakLet 2025-05-15 10:26:27 +02:00
Mykola Pokhylets
26106107eb Updated existing tests to run with feature enabled 2025-05-15 10:26:27 +02:00
Mike Ash
590c33ed70 [Runtime] Correctly initialize side tables of immortal objects on 32-bit.
The code to copy the refcounts from the object to a new side table wasn't quite right on 32-bit. Fix it to copy the PureSwiftDealloc field, and if the object is immortal, mark the side table's refcount as immortal too.

rdar://121943608
2024-01-31 17:08:06 -05:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52: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
Dmitri Gribenko
65d840c0ae stdlib: lowercase cases in Optional and ImplicitlyUnwrappedOptional 2016-02-18 00:40:33 -08:00
Slava Pestov
3d19691bab IRGen: Always use Swift reference counting when Obj-C interop is not available
The swift_unknown* entry points are not available on the Linux port.
Previously we would still attempt to use them in a couple of cases:

1) Foreign classes
2) Existentials and archetypes
3) Optionals of boxed existentials

Note that this patch changes IRGen to never emit the
swift_errorRelease/Retain entry points on Linux. We would like to
use them in the future if we ever adopt a tagged-pointer representation
for small errors. In this case, they can be brought back, and the
TypeInfo for optionals will need to be generalized to propagate the
reference counting of the payload type, instead of defaulting to
unknown if the payload type is not natively reference counted.
A similar change will need to be made to support blocks, if we ever
want to use the blocks runtime on Linux.

Fixes <rdar://problem/23335318>, <rdar://problem/23335537>,
<rdar://problem/23335453>.
2015-11-03 13:03:50 -08:00
Jordan Rose
aad003bb4e [test] Add a test for weak properties in 'let' structs.
A weak property in a struct can become nil even if the struct is immutable,
kind of as if the weak reference were actually indirected through a
(mutable) class. We might decide to disallow this someday, or formalize it
better, but as long as we allow it we shouldn't misoptimize it.

Swift SVN r32248
2015-09-25 23:37:18 +00:00
Slava Pestov
67a1f24d59 Sema: 'dynamic' attribute now diagnoses if Foundation is not imported
This prevents us from seeing a less useful error message from SILGen
further down the line.

Also fix a bug where @objc without importing Foundation was not diagnosed
after the first top-level form. Some tests were relying on this behavior,
so fix those tests, either by splitting off the objc parts of the test, or
just by passing the -disable-objc-attr-requires-foundation-module flag.

Fixes <rdar://problem/20660270>.

Swift SVN r29359
2015-06-10 01:18:27 +00:00
Arnold Schwaighofer
859fbc0162 More executable_test for the test directory
Swift SVN r29280
2015-06-03 23:28:51 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Graham Batty
83b4384fac Update test flags for linux failures and support.
Also removed the sdk 'feature' in favour of the more specific
objc_interop.

Swift SVN r24856
2015-01-30 21:31:48 +00:00
Graham Batty
83f27a8af7 Revert "Mark tests that don't pass on linux as XFAIL."
This reverts commit 2711ca86de7bf6a7885ccea24219a48a590b1e95.

Swift SVN r23577
2014-11-24 17:42:13 +00:00
Graham Batty
198402dcfe Mark tests that don't pass on linux as XFAIL.
Swift SVN r23573
2014-11-24 17:40:37 +00:00
Joe Pamer
94dac129d4 Remove the BooleanType conformance from optional types (rdar://problem/17110911)
To limit user confusion when using conditional expressions of type Bool?, we've decided to remove the BooleanType (aka "LogicValue") conformance from optional types. (If users would like to use an expression of type Bool? as a conditional, they'll need to check against nil.)

Note: This change effectively regresses the "case is" pattern over types, since it currently demands a BooleanType conformance. I've filed rdar://problem/17791533 to track reinstating it if necessary.

Swift SVN r20637
2014-07-28 19:20:39 +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
Joe Groff
4ce7d0f3ad Enable optional lvalues.
This causes a regression in error reporting where there are potential fixes: <rdar://problem/17741575> Other than that, everything works.

Swift SVN r20230
2014-07-20 18:16:42 +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
Dave Zarzycki
c86efe5e70 Tests: Enable weak reference testing
Swift SVN r18427
2014-05-19 20:28:48 +00:00
Chris Lattner
a3b406a4c4 previous patches fixed: <rdar://problem/16949978> weak implicitly unwrapped optional compiled as optional, not implicitly unwrapped
add a testcase.



Swift SVN r18317
2014-05-18 05:08:08 +00:00
Chris Lattner
e114121963 r18312 fixed <rdar://problem/15293354> Weak reference to class protocol crashes with "SIL verification failed: isa operand must be a class type"
Add the testcase.



Swift SVN r18316
2014-05-18 05:04:32 +00:00
Chris Lattner
052a564351 enable weak protocol test, which was fixed by r18312
Swift SVN r18313
2014-05-18 04:54:21 +00:00
Chris Lattner
72461d86c4 expand this test a bit. Zeroing weak pointers are still apparently non-functional, and
they crash in silgen for trivial weak protocols.


Swift SVN r18310
2014-05-18 04:33:35 +00:00
Chris Lattner
4352c71ded no need for the nested if, flatten it.
Swift SVN r18308
2014-05-18 04:22:04 +00:00
Chris Lattner
ae49b8bee2 add an executable test for weak pointers. It is somewhat concerning to me that
without the "w = nil" line that explicitly nil's out the weak pointer, that it fails.
I'm not sure what is going on here, but it looks like weak pointers are just broken.



Swift SVN r18307
2014-05-18 04:21:21 +00:00