-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationimprovementparserArea → compiler: The legacy C++ parserArea → compiler: The legacy C++ parser
Description
| Previous ID | SR-2843 |
| Radar | None |
| Original Reporter | @rintaro |
| Type | Improvement |
| Status | Resolved |
| Resolution | Done |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Improvement, DiagnosticsQoI, Parser |
| Assignee | @rintaro |
| Priority | Medium |
md5: fbd582e6c946f2b68fd9f11d57aa8e9b
Issue Description:
These constructs are very confusing for me:
typealias A = P1 & P2? // protocol<P1, P2>?
typealias B = P1 & P2.Type // protocol<P1, P2>.Type
typealias C = P1 & P2.Protocol // protocol<P1, P2>.ProtocolWe should warn with fix-it to enclose protocol composition with parens. (e.g. (P1 & P2).Type)
Or reject them with error message such as:
error: non-protocol type 'P2?' cannot form a protocol composition
typealias D = P1 & P2? & P3
^~~Metadata
Metadata
Assignees
Labels
compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationimprovementparserArea → compiler: The legacy C++ parserArea → compiler: The legacy C++ parser