Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14505] Improve diagnostic to use 'property' when missing return #56857

Closed
typesanitizer opened this issue Apr 17, 2021 · 3 comments
Closed
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement

Comments

@typesanitizer
Copy link

Previous ID SR-14505
Radar rdar://problem/76802612
Original Reporter @typesanitizer
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI
Assignee luciano (JIRA)
Priority Medium

md5: 85c7ad5b6106cb41a77a0c9f8ef8a7a0

Issue Description:

let b = true
struct S {
    var x: Int {
        if b {
            return 0
        }
    } // error: missing return in a function expected to return 'Int'
}

It would be a little bit nicer if we said "missing return in a property" instead of "missing return in a function".

@typesanitizer
Copy link
Author

@swift-ci create

@typesanitizer
Copy link
Author

mininny (JIRA User) Luciano has submitted a PR for this: #36952

@LucianoPAlmeida
Copy link
Collaborator

Sorry mininny (JIRA User) my mistake, I forgot to set the assignment of the ticket when started.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation improvement
Projects
None yet
Development

No branches or pull requests

2 participants