Skip to content

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

@lattner

Description

@lattner
mannequin
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions