Anthony Latsis
7b92a8f041
AST: Quote attributes more consistently in DiagnosticsParse.def
2025-04-23 19:18:11 +01:00
Anthony Latsis
5e41794680
AST: Quote attributes more consistently in DiagnosticsSema.def
2025-04-23 19:18:08 +01:00
Pavel Yaskevich
afa66b1a6b
[AST] Rework diagnostic about init accessors inside of extensions
2024-06-19 11:24:55 -07:00
li3zhen1
faf1d2b724
[Decl] Add tests for invalid extension and multi file access of init accessors
2024-05-04 08:24:37 -07:00
Alex Hoppen
17e6a25234
[Parse] Accumulate a parser status while parsing attributes
2023-09-27 09:33:38 -07:00
Pavel Yaskevich
416bbaec8d
[TypeChecker] InitAccessors: Fix handling of defaultable init accessor properties during default init synthesis
...
Default initializable init properties shouldn't prevent default
init synthesis and such properties without anything to initialize
should be considered by it.
2023-08-21 09:05:26 -07:00
Pavel Yaskevich
645e8df6bd
[TypeChecker] InitAccessors: Synthesize default init for init accessor properties
...
Fixes a bug were default initializer for an init accessor property
hasn't been synthesized even when the property is marked as default
initializable.
Resolves: rdar://113421273
2023-08-21 09:04:34 -07:00
Pavel Yaskevich
2a0651e8b0
[Frontend/NFC] SE-0400: Enable InitAccessors feature by default
2023-07-31 13:18:59 -07:00
Pavel Yaskevich
0bbf3403e4
[Parse] InitAccessors: Diagnose an attempt to use init accessor without a getter
2023-07-11 13:45:38 -07:00
Pavel Yaskevich
fe17491982
[AST] InitAccessors: Switch from init accessor effects (initializes/accesses) to @storageRestrictions
2023-07-07 10:00:36 -07:00
Pavel Yaskevich
94522ff81a
[Sema] InitAccessors: Implement validation of @storageRestrictions attribute
2023-07-07 10:00:36 -07:00
Pavel Yaskevich
9992af593c
[Parse] InitAccessors: Implement @storageRestrictions parsing, diagnostics and error recovery
2023-07-07 10:00:36 -07:00
Pavel Yaskevich
8a1107ea45
[Tests] InitAccessors: Test use of init accessor properties without setters
2023-07-04 00:05:25 -07:00
Doug Gregor
fe2dec5ee5
[SE-0400] All properties with init accessors become part of the memberwise init
...
Per the clarification during the review thread, all properties with
init accessors (including those that do not initialize any underlying
storage) are part of the memberwise initializer.
2023-06-27 17:28:53 -07:00
Pavel Yaskevich
8b1c9c9be8
[Parse] InitAccessors: Parse initializer exprs associated with computed properties that have init accessor
...
Initialization expressions are not allowed on computed properties
but if a property has `init` accessor it should be allowed because
it could be used by a memberwise initializer.
2023-06-15 11:38:06 -07:00
Pavel Yaskevich
34c8cf60f1
[Sema/SILGen] InitAccessors: Memberwise initializers with init accessors should follow field order
...
Skip stored properties that are initialized via init accessors and
emit parameters/initializations in field order which allows us to
cover more use-cases.
2023-06-13 13:56:33 -07:00
Pavel Yaskevich
cffc3fd73d
[Sema/SILGen] InitAccessors: Don't synthesize memberwise init if initializes intersect
...
If some property is initializable by one than one init accessor
let's not sythesize a memberwise initializer in that case because
it's ambiguous what is the best init accessor to use.
2023-06-13 12:40:41 -07:00
Pavel Yaskevich
4f59538eba
[Sema] InitAccessors: Diagnose situations when memberwise init cannot be synthesized
...
If some of the properties with init accessors have out of order
accesses diagnose that while checking whether memberwise init
could be synthesized.
2023-06-13 10:58:50 -07:00
Pavel Yaskevich
ddcfe01ba5
[Sema/SILGen] InitAccessors: Emit intersecting init accessor calls in memberwise init
...
If init accessor initialize the same properties, let's emit them
in sequence and emit `destroy_addr` in-between to make sure that
there is no double initialization.
2023-06-13 10:58:50 -07:00
Pavel Yaskevich
db024d973e
[CSDiagnostics] InitAccessors: Implement invalid member reference diagnostics within init accessors
2023-06-13 10:58:50 -07:00
Pavel Yaskevich
5613006944
[Sema] PreCheck: Diagnose standalone self within init accessors
...
'self' within init accessor could only be used to refer to
properties listed in `initializes` and `accesses` attributes.
2023-06-13 10:58:50 -07:00
Pavel Yaskevich
a71b9c28c0
[Tests] InitAccessors/NFC: All init accessor tests require "asserts"
...
Because the feature is experimental and the flag would not be present
in the production compilers.
2023-06-06 18:59:46 -07:00
Pavel Yaskevich
0e61a75ef9
[Parser] InitAccessors: Properties in initializes/accesses should be separated by comma
2023-06-06 18:59:46 -07:00
Pavel Yaskevich
22061e6621
[Sema] InitAccessors: Verify that a property never appears both in initializes(...) and accesses(...)
2023-06-06 18:59:46 -07:00
Pavel Yaskevich
4dbaaf3b23
[AST] InitAccessors: Allow assignments to let properties
2023-06-06 18:59:13 -07:00
Pavel Yaskevich
a090eb4e17
[Parse] InitAccessor: Reject init accessor declarations on subscripts
2023-06-06 18:59:13 -07:00
Pavel Yaskevich
4a4bf3bd77
[Sema] InitAccessors/NFC: Add tests for invalid references in initializes/accesses attributes
2023-06-06 18:59:13 -07:00
Pavel Yaskevich
d7f5419623
[AST] InitAccessors: Add initializes/accesses attribute location validation
2023-06-06 18:59:13 -07:00
Pavel Yaskevich
f96e1d7a4e
[Parse] InitAccessors: Validate that init accessor declaration context
...
Init accessors are only allowed on properties.
2023-06-06 18:59:13 -07:00