[SR-11768] Stored property declaration + initialization expressions cannot be inlinable #54175
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
library evolution
Feature: library evolution (umbrella feature for features that facilitate resilient libraries)
performance
Environment
Apple Swift version 5.1.1 (swiftlang-1100.0.275.2 clang-1100.0.33.9)
Target: x86_64-apple-darwin19.0.0
Additional Detail from JIRA
md5: 93b4655140ea361188fad126d2aa580e
relates to:
Issue Description:
Consider the following structure:
When this initialiser is called from another module (like
Foo(x: 1)
) when compiled in release mode, the initializer generates the following code:This indicates that the initialization expression is actually a function. That function cannot be marked inlinable, which means for trivial initialization expressions like this one we incur the cost of a jump to the call site for this expression, even though it's a simple constant integer store.
I think the issue here is just that it needs to be possible to spell inlinability here.
The text was updated successfully, but these errors were encountered: