Skip to content

Commit 0bab515

Browse files
committed
Sema: Build type checked bodies for trivial accessors
This includes all synthesized accessors except for lazy getters and observer setters. Building checked AST has certain advantages: - It is faster, avoiding the need to create and solve ConstraintSystems or performing various diagnostic and semantic walks over the AST. - It allows us to postpone delayed body synthesis until needed in SILGen, instead of having to walk a list of "external declarations" in Sema. It also unblocks lazier conformance checking. Now that SILGen can trigger conformance checking on its own, we need to be able to synthesize bodies of accessors that witness protocol requirements. This will allow us to eventually remove Sema's "used conformances" list. Note that for now, various utility functions in CodeSynthesis.cpp are used for both checked and unchecked function bodies, so they take a 'typeChecked' boolean parameter that complicates some logic more than necessary. Once the remaining body synthesizers are refactored to build type-checked AST, the 'typeChecked' flag will go away.
1 parent d22b3a7 commit 0bab515

File tree

7 files changed

+760
-504
lines changed

7 files changed

+760
-504
lines changed

0 commit comments

Comments
 (0)