Don't force inlinable constructors to delegate in non-resilient code #14721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This restriction came from wanting to make resilient and non-resilient code follow the same rules whenever possible, but after thinking about it a bit more we realized there was no reason why you wouldn't just mark your structs
@_fixed_layout
in non-resilient libraries anyway. Since that (currently?) doesn't affect what you can do with the struct across module boundaries, and since the layout of the struct is available anyway in a non-resilient library, there's no real downside, which means it's a meaningless restriction.The same logic doesn't quite apply to classes, since classes are normally much more flexible than structs. (For example, you could add a stored property to a class without recompiling clients, as long as no initializers are inlined.) But it's close enough that we don't want to put in the restriction at this time.
All of this is about attributes that haven't been finalized yet anyway (hence the leading underscore), but it's still useful information.
rdar://problem/37408668