A statement-level operator expression that evaluates to a View — most
notably `Text + Text` concatenation — was built but never composed: the
ViewBuilder transform only added a `.Compose(composectx)` tail call to
APICallExpression statements, so a bare `Text("a") + Text("b")` was
constructed and discarded (no Compose node, zero size). Wrapping it in
`.frame(...)` "fixed" it only because the outer call then got the tail
call.
Add a tail call for statement-level binary-operator expressions whose
inferred result type conforms to View, wrapping the operator in
parentheses so `.Compose` applies to the whole result rather than its
right-hand operand: `(Text("a") + Text("b")).Compose(composectx)`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vincentborko added a commit to vincentborko/skip-ui that referenced this pull request
Jun 2, 2026`static func + (Text, Text)` was previously `fatalError()`, so any SwiftUI that builds a multi-style inline string by concatenation (per-segment color / weight / size / italic / monospaced / underline / strikethrough / gradient) could not run on Android. Both runtimes now feed one ordered `[TextRun]` model: - Skip Lite (transpiled) via a native `+` operator (`Text.plus`, `// SKIP DECLARE: operator fun plus`), capturing each operand's styling as `TextRunStyle` data (a styled `Text` applies its style as an environment modifier that can't be read back at render time). - SkipFuse via `init(bridgedRuns:colors:fontSizes:fontWeights:flags:)`, which folds primitive per-run descriptors into the same `[TextRun]`. The concatenation *is* a `_Text` carrying its `runs`, folded into a single `AnnotatedString` (each run's styling as a `SpanStyle`) and rendered by the shared `_Text.Render` path — so environment concerns (alignment, line limit + truncation, tracking, line spacing, `material3Text`) behave like any other `Text`, with no duplicated render logic. Pairs with skiptools/skip-fuse-ui#118 (the SkipSwiftUI run model). Bare, unconstrained `Text + Text` requires the transpiler fix in skiptools/skipstone#255 to be composed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced
Jun 2, 2026Open
Open