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-3377] @discardableResult not inherited by subclass overriding method #45965

Closed
an0 mannequin opened this issue Dec 9, 2016 · 0 comments
Closed

[SR-3377] @discardableResult not inherited by subclass overriding method #45965

an0 mannequin opened this issue Dec 9, 2016 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@an0
Copy link
Mannequin

an0 mannequin commented Dec 9, 2016

Previous ID SR-3377
Radar None
Original Reporter @an0
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: c479d78340d4539d94cda498bff8495a

duplicates:

Issue Description:

class A {
    @discardableResult func foo() -> Int {
        return 1
    }
}

class B: A {
    override func foo() -> Int {
        return 2
    }
}

B().foo() // Reports "Result of call to 'foo()' is unused" but shouldn't.
@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

0 participants