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-15688] Improve Parser Recovery and Diagnostics for Import Paths with Operators in Them #57967

Closed
CodaFi opened this issue Jan 5, 2022 · 4 comments

Comments

@CodaFi
Copy link
Member

@CodaFi CodaFi commented Jan 5, 2022

Previous ID SR-15688
Radar rdar://problem/87159294
Original Reporter @CodaFi
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Parser, StarterBug
Assignee @angela-laar
Priority Medium

md5: d8dd3d94d5f74900b7099a089ec5b725

Issue Description:

These have never once worked, so we ought to do a better job of detecting and diagnosing them. Right now operator folding kicks in and we just get a cascade of bad errors

import func SwiftUI.Text.== 
// Consecutive statements on a line must be separated by ';'
// Operator with postfix spacing cannot start a subexpression
// Expected expression
// 'Text' was imported as 'func', but it is a struct
//  Operator with postfix spacing cannot start a subexpression

Right after we call parseAnyIdentifier in parseImportDecl would be the right place to check, diagnose, and delete these operator components.

@CodaFi
Copy link
Member Author

@CodaFi CodaFi commented Jan 5, 2022

@swift-ci create

@angela-laar
Copy link
Contributor

@angela-laar angela-laar commented Jan 20, 2022

PR has been reviewed: #40836

@CodaFi
Copy link
Member Author

@CodaFi CodaFi commented Jan 21, 2022

Excellent branch name.

@angela-laar
Copy link
Contributor

@angela-laar angela-laar commented Jan 22, 2022

Thanks 🙂

@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

2 participants