Skip to content

[SR-3359] [QoI] Warn if @discardableResult used with void result. #45947

@swift-ci

Description

@swift-ci
Previous ID SR-3359
Radar None
Original Reporter aaroncrespo (JIRA User)
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, StarterBug
Assignee matthew carroll (JIRA)
Priority Medium

md5: b2778488745a5fbb25973db793f3d89c

Issue Description:

Noticed that:

@discardableResult func foo() {
  print("hello")
}
foo()

Didn't raise a warning or error when compiled. My thoughts are that it should?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions