-
Notifications
You must be signed in to change notification settings - Fork 427
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-8510] 'guard' is easy to misspell as 'gaurd', results in large number of follow-on errors, and could have a fixit. #2198
Comments
This could also apply arbitrary misspellings of |
@rintaro, think this is possible for a StarterBug? Or would it be too complicated? |
Yeah this is good |
Comment by Bruno Rocha (JIRA) @huonw Are you working on this? I would like to give it a shot if nobody assigned it 🙂 |
Go for it. (Huon's not working on Swift at all these days, but he's also just the filer, not necessarily the implementer.) |
Resetting assignees for all Starter Bugs that haven't been touched since 2018. |
Comment by Noah Wilder (JIRA) To determine whether or not to offer a spelling suggestion, we can probably use the Levenshtein distance between the typo and the correct spelling, and, if it is within a certain threshold, offer a fix-it to correct it to possible keywords and/or identifiers. |
@Rish-it You are welcome to work on this! Let me know if you would like to be assigned. |
Environment
Master at 2018-08-09
Additional Detail from JIRA
md5: 83854736e7d37441acce9e16b297a24a
Issue Description:
In the following code, the guard statement is misspelled, and it results in 6 errors, plus notes and warnings! It'd be neat if the compiler detected when the "consecutive statements" error starts with the identifier
gaurd
, and assumed thatguard
was what was meant (along with a fixit so the user swaps it). I think that only doing this when that error occurs is important, because someone could legitimately havevar gaurd = 1; gaurd = 2; print(gaurd)
, and none of those should change toguard
.Possible new version:
The text was updated successfully, but these errors were encountered: