[SR-15665] Failed to produce diagnostic for expression, when using Builder pattern with Generics #59603
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler 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
Xcode 13.2(included Swift 5.5)
OS: MacOS 12.1 Monterey(plz, refer the details in the 1st screen shot)
Testing Device on running the codes: iPad Air 9gen., iOS simulators
Additional Detail from JIRA
md5: 08d1c24459a3c9359296d685692609e4
Issue Description:
I've tried to use the Builder pattern in the swift, especially with the Generics.
But the swift complier said "Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs)" and include the project".
Originally, I've tried to configure the similar with the SwiftUI struct's styles for the passing values.
My codes are like below.
I defined the custom button styles in the separated target as framework. And I'd like to set the Button background color(or using Gradient), using the Builder pattern.
The structs & classes related to the Builder patterns are complied well.
But, the problem is occurred on the codes to use the Builder.
Specially when I use the different struct types as a property of the custom Button styles, it's occurred the compile error. Please refer the below codes.
So, I followed the compile error message and I reported the bug.
If I'm using the wrong way to use the Generics in Swift, plz, let me know & guide me.
The text was updated successfully, but these errors were encountered: