Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Medium
-
Resolution: Done
-
Component/s: Compiler
-
Labels:
-
Environment:
Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.0.0
-
Radar URL:
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'