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-1938] Implement support for SE-0095: Replace protocol<P1, P2> syntax with P1&P2 #44547

Closed
lattner mannequin opened this issue Jun 30, 2016 · 7 comments
Closed

[SR-1938] Implement support for SE-0095: Replace protocol<P1, P2> syntax with P1&P2 #44547

lattner mannequin opened this issue Jun 30, 2016 · 7 comments

Comments

@lattner
Copy link
Mannequin

@lattner lattner mannequin commented Jun 30, 2016

Previous ID SR-1938
Radar None
Original Reporter @lattner
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, StarterBug
Assignee joewillsher (JIRA)
Priority Medium

md5: 49622b054b5547ddd9b9666615171a2a

Issue Description:

SE-0095 has been accepted, and we need an implementation. This consists of a few straight-forward pieces of work:

  • "Parse" the "P1 & P2" style syntax in the type production grammar.

  • Enhance PreCheckExpression to combine "P1 & P2" into a TypeExpr to cover the expression grammar case.

  • Make Any be a keyword, and make it generate the same AST as we form for protocol<> today.

  • Change the parser logic for the protocol<P1,P2> syntax to generate a warning+fixit for the new syntax.

  • Upgrade that warning to an error a couple of weeks later.

I'd suggest keeping the AST representation exactly the same as we have now for simplicity.

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Jun 30, 2016

Comment by Josef Willsher (JIRA)

Hi Chris, I’d like to take up work on this.

I’ve already done some work on the parsing; once I get Git working properly progress will be here https://github.com/joewillsher/swift

@lattner
Copy link
Mannequin Author

@lattner lattner mannequin commented Jun 30, 2016

Sounds great![]( Please send PR's for each small piece (which can be individually tested) as you make progress. Thanks)

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Jun 30, 2016

Comment by Josef Willsher (JIRA)

My initial work is here joewillsher@d5eb88b25cbeaecf5127f9496db9faed4075473d, I’m updating the tests now.

Also this change doesn't affect SIL syntax does it? The proposal doesn't mention it but it feels like a strange inconsistency for it to continue using the protocol<...> syntax.

@lattner
Copy link
Mannequin Author

@lattner lattner mannequin commented Jun 30, 2016

We should discuss what to do with the SIL syntax on the swift-dev list. The most important/time critical part is to sort out the ".swift" syntax issue.

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Jul 1, 2016

Comment by Josef Willsher (JIRA)

Great, first PR here: #3293

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Jul 6, 2016

Comment by Josef Willsher (JIRA)

@lattner I think [the PR](#3293 is ready to test and merge; I only have changing the demangler/printer’s syntax left, which I will do in a follow up PR.

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Jul 8, 2016

Comment by Josef Willsher (JIRA)

That is complete too, as well as code completion for the Any keyword.

The tests are all passing; attr/attr_objc.swift seems to be crashing but I don’t think it is related to the parser/type system changes I made.

@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

1 participant