Skip to content

Conversation

@tshortli
Copy link
Contributor

Allow initializer expressions to be emitted during SILGen when -experimental-lazy-typecheck is specified by introducing a new request that fully typechecks the init expressions of pattern binding declarations on-demand.

There are still a few rough edges, like missing support for wrapped properties and incomplete handling of subsumed initializers. Fixing these issues is not an immediate priority because in the short term -experimental-lazy-typecheck will always be accompanied by -enable-library-evolution and -experimental-skip-non-exportable-decls. This means that only the initializers of properties on @frozen types will need to be emitted and property wrappers are not yet fully supported on properties belonging to @frozen types.

Resolves rdar://117448868

@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli marked this pull request as draft November 14, 2023 17:58
Allow initializer expressions to be emitted during SILGen when
`-experimental-lazy-typecheck` is specified by introducing a new request that
fully typechecks the init expressions of pattern binding declarations
on-demand.

There are still a few rough edges, like missing support for wrapped properties
and incomplete handling of subsumed initializers. Fixing these issues is not an
immediate priority because in the short term `-experimental-lazy-typecheck`
will always be accompanied by `-enable-library-evolution` and
`-experimental-skip-non-exportable-decls`. This means that only the
initializers of properties on `@frozen` types will need to be emitted and
property wrappers are not yet fully supported on properties belonging to
`@frozen` types.

Resolves rdar://117448868
@tshortli tshortli force-pushed the silgen-lazy-typecheck-pattern-executable-init branch from dc3d849 to 111eea7 Compare November 14, 2023 19:54
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli marked this pull request as ready for review November 14, 2023 19:55
@tshortli tshortli merged commit 8aa0a3c into swiftlang:main Nov 15, 2023
@tshortli tshortli deleted the silgen-lazy-typecheck-pattern-executable-init branch November 15, 2023 00:57
tshortli added a commit to tshortli/swift that referenced this pull request Nov 16, 2023
…tion.

As a follow up to swiftlang#69841, clarify the
possible states that initializer expression of a pattern can be in. The
possible states are not checked, checked, and "checked and contextualized"
(which is the new state that was introduced and requestified in the previous
PR). This refactoring encodes the states more explicitly and renames a few
compiler APIs to better align with the new naming. NFC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant