Skip to content

Commit f720eea

Browse files
committed
Sema: Teach the compiler to refine VarDecl initializer expressions using the deployment target when the init would not be exposed to module clients. Without this, the initializers of public properties in API modules could be misdiagnosed as potentially unavailable to clients of the module, even though the expression will only ever execute on the deployment target or higher.
While developing this fix I discovered a few other bugs that will need to be addressed separately: - The availability of the inferred type of a property is not diagnosed. Previously this mattered less since the initializer expression and the var declaration itself would both be diagnosed with the same availability. - The availability of the property wrapper type of a `VarDecl` appears to not be diagnosed at all. - Members of frozen structs with property wrappers result in broken swiftinterfaces because the synthesized storage is printed explicitly, confusing the diagnostics. Resolves rdar://92713589
1 parent 2f30304 commit f720eea

File tree

2 files changed

+347
-237
lines changed

2 files changed

+347
-237
lines changed

0 commit comments

Comments
 (0)