Swift: backticks are required to disambiguate unambiguous keywords
| Originator: | rix.rob | ||
| Number: | rdar://21290286 | Date Originated: | 08-Jun-2015 06:14 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-7-beta (7A120f) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
You can write a method named e.g. return (or catch, or defer, etc) but you have to put backticks around it. But in most places where you’re using the symbol it’s already disambiguated by where it’s occuring syntactically.
For example, you should be able to do this:
func func() {}
The latter occurrence of “func” is unambiguous. It can’t be the start of another function; that is not how these things work. Unfortunately, nobody told the lexer that.
If the parser were scannerless the lexer’s problems wouldn’t be my problem.
Steps to Reproduce:
N/A
Expected Results:
N/A
Actual Results:
N/A
Regression:
N/A
Notes:
N/A
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!