Subclass initializer parameters don’t inherit result builder attributes #60953
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler itself
result builders
Feature: Result builders
type checker
Area → compiler: Semantic analysis
Describe the bug
If a class has an initializer with a parameter that has a result builder on it, subclasses which inherit that initializer won’t have the result builder attribute on the parameter.
Steps To Reproduce
Expected behavior
Sub.init(body:)
would have@ViewBuilder
on its parameter, soViewBuilder
would be applied to the closure and the code would typecheck.Environment (please fill out the following information)
Seen in:
Additional context
We originally saw this with a simple custom result builder using a variadic
buildBlock
, so it’s not specific to@ViewBuilder
.Thanks to @quephird for showing me this bug.
The text was updated successfully, but these errors were encountered: