[SR-10983] Synthesizing Initializer with Default Values Fails with Empty Property Wrapper Initializer #53373
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
property wrappers
Feature: property wrappers
Attachment: Download
Environment
Apple Swift version 5.1 (swiftlang-1100.0.43.3 clang-1100.0.26.3)
Target: x86_64-apple-darwin18.6.0
Xcode 11.0 beta 2 (11M337n)
macOS 10.14.5 (18F132)
Additional Detail from JIRA
md5: e11e42c6502eb9c93d5ca94efca08d88
Issue Description:
I created a property wrapper that holds types that conform to
LosslessStringConvertible
. Along with theinitialValue
initializer, it has a zero-argument initializer that creates an instance of the wrapped type with an empty string.When I create a struct that uses the property wrapper on a property and try to use the default initializer without parameters, I get a compiler crash:
Here is a MVP to create the crash:
A couple of things to note:
Removing the
initialValue
initializer fixes the issue.Passing in a custom value to the `Foo` initializer instead of using the default argument also fixes the issue.
The text was updated successfully, but these errors were encountered: