Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SE-0400: State limitations #2389

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion proposals/0400-init-accessors.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,21 @@ init() {
}
```

### Restrictions

A property with an `init` accessor can only be declared in the primary
declaration of a type.

## Source compatibility

`init` accessors are an additive capability with new syntax; there is no impact on existing source code.

## ABI compatibility

`init` accessors are only called from within a module, so they are not part of the module's ABI. In cases where a type's initializer is `@inlinable`, the body of an `init` accessor must also be inlinable.
`init` accessors are an ABI-additive change; they are at most `internal` but can
be ABI-public.
Calling an `init` accessor from an `inlinable` type initializer requires that
the `init` accessor is ABI-public.

## Implications on adoption

Expand Down