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-8850] swiftc error for unsupported -swift-version shouldn't tell user to use major version #51356

Closed
lilyball mannequin opened this issue Sep 25, 2018 · 5 comments
Closed

Comments

@lilyball
Copy link
Mannequin

@lilyball lilyball mannequin commented Sep 25, 2018

Previous ID SR-8850
Radar rdar://problem/44797691
Original Reporter @lilyball
Type Bug
Status Closed
Resolution Done
Environment

Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.0.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Driver
Assignee @belkadan
Priority Medium

md5: acbde8337bb87d5f58122c392669a832

Issue Description:

Right now passing an unsupported minor Swift version to swiftc -swift-version tells the user to use a major version number. This error message is bad because we actually support a version with a minor version number (4.2). The other problem with this error is it doesn't tell the user what the supported versions are, which the error you get by specifying an unsupported major version number does. The fact that the other error tells the user what the supported versions are is sufficient info to let them infer that they should usually not specify a minor version.

Current behavior:

$ swiftc -swift-version 4.1 foo.swift
<unknown>:0: error: invalid value '4.1' in '-swift-version 4.1'
<unknown>:0: note: use major version, as in '-swift-version 4'

Expected behavior:

$ swiftc -swift-version 4.1 foo.swift
<unknown>:0: error: invalid value '4.1' in '-swift-version 4.1'
<unknown>:0: note: valid arguments to '-swift-version' are '3', '4', '4.2', '5'
@belkadan
Copy link
Contributor

@belkadan belkadan commented Sep 26, 2018

Oops. It made sense in the past!

@swift-ci create

@belkadan
Copy link
Contributor

@belkadan belkadan commented Nov 14, 2018

@belkadan
Copy link
Contributor

@belkadan belkadan commented Dec 10, 2018

5.0: #21169

but I can see the release managers deciding not to include it cause it's so small.

@AnnaZaks
Copy link
Mannequin

@AnnaZaks AnnaZaks mannequin commented Jul 23, 2019

Eridius (JIRA User), Could you verify if the problem is fixed and if so move the JIRA to "Closed"?

Thanks!
Anna

@lilyball
Copy link
Mannequin Author

@lilyball lilyball mannequin commented Jul 23, 2019

Confirmed as fixed with swift 5.0.1.

@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
Projects
None yet
Development

No branches or pull requests

1 participant