[SR-11494] Inconsistent stored Type property initialization #53895
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
optimized only
Flag: An issue whose reproduction requires optimized compilation
Attachment: Download
Environment
Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)
Target: x86_64-apple-darwin18.7.0
Additional Detail from JIRA
md5: 91486b04671c58c338d057aed49946b1
Issue Description:
Stored type properties are supposed to be lazily initialized on their first access.
As per the Documentation
However, it was observed from a StackOverflow Question that when compiled with the -O flag to optimize code during compilation. The Stored Type Property is initialized yet it was never accessed and is not reachable during execution.
Find the attached swift file to replicate this behavior.
When complied -O flag
When complied -Onone flag
The text was updated successfully, but these errors were encountered: