[SR-1469] Diagnostic for init? reported at the end despite of early return #44078
Labels
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
good first issue
Good for newcomers
improvement
Additional Detail from JIRA
md5: 86204ca1807df504b7b7f3c9d8e2cf61
Issue Description:
When a property is not initialized, the Swift compiler points to the end of a initializer and complains. This can be confusing when the initializer has early returns. For example:
Note the error is caused by the early return, but it's not immediately clear given that `b` appears to have been initialized near the end.
Solution: issue the diagnostic message at the early return statement.
The text was updated successfully, but these errors were encountered: