[SR-10577] Compiler fails to produce diagnostic for expression when casting protocol to subprotocol #52977
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
failed to produce diagnostic
Bug → internal error: Failed to produce diagnostic for expression
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Swift 5.0.1
Xcode Version 10.2.1 (10E1001)
macOS 10.14.4 (18E226)
Additional Detail from JIRA
md5: 1face1c5ee79656f800914ebc9379fd2
Issue Description:
Inside a flatMap, after a compactMap, the compiler fails to produce diagnostic for "as?" expression when casting protocol to another protocol.
The error message thrown by the compiler reads as follow:
"error: failed to produce diagnostic for expression; please file a bug report"
I attached, here, a Playground that showcases the error message being displayed. Also, the sample code can be seen bellow.
P.s.: When the return method for the flatMap is specified, the compiler is able to understand and compile properly.
The text was updated successfully, but these errors were encountered: