Skip to content

[SR-7427] Warning seen on Linux, but not on Darwin #3724

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

Closed
alblue opened this issue Apr 13, 2018 · 3 comments
Closed

[SR-7427] Warning seen on Linux, but not on Darwin #3724

alblue opened this issue Apr 13, 2018 · 3 comments
Assignees

Comments

@alblue
Copy link
Contributor

alblue commented Apr 13, 2018

Previous ID SR-7427
Radar None
Original Reporter @alblue
Type Bug
Status Closed
Resolution Duplicate
Environment

Maybe the Darwin version has a @discardableResult inferred, but the Linux version doesn't?

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @keith
Priority Medium

md5: ffc858aa35aaef61dbab2dde595ed6f7

Issue Description:

With the following code, and running on Swift 4.1:

import Foundation
FileManager.createFile(atPath:"/tmp/foo", contents:Data())

I get no compile warning on Swift 4.1 (Apple Swift version 4.1) but I do on Swift 4.1-Linux

tst.swift:2:21: warning: result of call to 'createFile(atPath:contents:attributes🙂' is unused

@belkadan
Copy link

All imported methods get @discardableResult by default unless they have the warn_unused_result attribute. But I don't know which version the Foundation folks would rather be consistent on.

@keith
Copy link
Member

keith commented Oct 30, 2018

#1742

@keith
Copy link
Member

keith commented Oct 30, 2018

Closing as dup of https://bugs.swift.org/browse/SR-1638 but my linked PR fixes both

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from swiftlang/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants