Regex { let e0 = RegexComponentBuilder.buildExpression(regex0) // Component<Regex<Substring>> let e1 = RegexComponentBuilder.buildExpression(regex1) // Component<Regex<(Substring, Int)>> let e2: Regex<(Substring, Float)> if condition { let comp = RegexComponentBuilder.buildExpression(regex2) // Component<Regex<(Substring, Float)>> e2 = RegexComponentBuilder.buildEither(first: comp) // Regex<(Substring, Float)> } else { let comp = RegexComponentBuilder.buildExpression(regex3) // Component<Regex<(Substring, Float)>> e2 = RegexComponentBuilder.buildEither(first: comp) // Regex<(Substring, Float)> } let r0 = RegexComponentBuilder.buildPartialBlock(first: e0) let r1 = RegexComponentBuilder.buildPartialBlock(accumulated: r0, next: e1) let r2 = RegexComponentBuilder.buildPartialBlock(accumulated: r1, next: e2) return r2 } // Regex<(Substring, Int, Float)>