Diagnostic when trying to write exclusive ranges as ..<
#112254
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Suggest
0..10
.Rationale and extra context
The syntax
..=
for inclusive ranges seems to suggest..<
for exclusive ranges, especially since Swift uses..<
for exclusive ranges.(Though, Swift doesn't use
..=
for inclusive ranges, but rather…
.)I initially thought this would be easy to diagnose since
..<
is never legal syntax, but actually it can be legal as part of an exclusive range where the upper bound is an UFCS call:Oh well.
The text was updated successfully, but these errors were encountered: