You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also tested with Swift 5.5 Development Snapshot from 2021-04-20.
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: abcfd4bd21989fb758c8323471ae9957
Issue Description:
When a result builder is applied to a protocol requirement, it is automatically applied for any conformers. However, this automatic application fails if the builder involves a typealias scoped to the protocol in question:
@resultBuilderstructBuilder<T>{staticfunc buildExpression(_ expression:T)->[T]{[expression]}staticfunc buildBlock(_ components:[T]...)->[T]{Array(components.joined())}}typealiasOutsideString=StringtypealiasOutsideStringBuilder=Builder<String>protocolBuildable{typealiasInsideString=StringtypealiasInsideStringBuilder=Builder<String>// these crash://@Builder<InsideString>//@InsideStringBuilder// these work fine://@OutsideStringBuilder//@Builder<OutsideString>//@Builder<String>func build()->[String]}structBuilding:Buildable{// at this site they all work; just using this as an example@InsideStringBuilderfunc build()->[String]{"foo""bar"}}
There are comments in the code snippet for more information. The crash occurs when any type alias is involved in the annotation, whether as a generic parameter (@Builder<InsideString>) or as the type itself (@InsideStringBuilder).
The crash does not occur if you don't declare a type implementing that member or if you override the builder (explicitly specifying it) for that member in the conforming type.
I've attached a build log exhibiting the crash.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
Xcode 12.5, macOS 11.3
Also tested with Swift 5.5 Development Snapshot from 2021-04-20.
Additional Detail from JIRA
md5: abcfd4bd21989fb758c8323471ae9957
Issue Description:
When a result builder is applied to a protocol requirement, it is automatically applied for any conformers. However, this automatic application fails if the builder involves a
typealias
scoped to the protocol in question:There are comments in the code snippet for more information. The crash occurs when any type alias is involved in the annotation, whether as a generic parameter (
@Builder<InsideString>
) or as the type itself (@InsideStringBuilder
).The crash does not occur if you don't declare a type implementing that member or if you override the builder (explicitly specifying it) for that member in the conforming type.
I've attached a build log exhibiting the crash.
The text was updated successfully, but these errors were encountered: