Sema: respect @usableFromInline / AEIC on property setters in inlinable-access check. #90315
@swift-ci please smoke test
Isn't this duplicating logic that should be part of ValueDecl::isUsableFromInline()?
It's not a big deal, but is it not faster to first check getFormalAccess() levels and then call isSetterUsableFromInline(...)?
Besides my comment, looks good, thanks!
This fix ensures that Sema accepts these patterns, but are we sure they function correctly? Are these cases already tested in the ModuleInterface suite and in SILGen to ensure that the compiler emits the setters with the correct linkage visibility?
@tshortli You're right to push on this! I checked end-to-end and the module interface printing story doesn't line up well with the drop of the warning. For @usableFromInline set the printer drops internal(set) and emits @usableFromInline on a now-public setter (illegal); for @_alwaysEmitIntoClient the setter isn't surfaced in the interface at all, so inlinable code that assigns it can't round-trip. These warnings are desirable to make sure the module interface is healthy.
I plan to redirect these added tests to test that we do emit warnings here. Any objections?
tshortli
nkcsgexi
https://github.com/swiftlang/swift/issues/90162 and rdar://180516542