Tags: zio/zio-blocks
Tags
feat(scope): N-ary $ operator (N=2..5) and macro safety fixes (#1193) * feat(scope): add N-ary $ operator (N=2..5) and fix pre-existing macro safety gaps The unary $ macro is extended to support simultaneous access to N scoped values (N=2..5). The receiver-only grammar is symmetric across all N params: each vi may only appear as a method receiver; feeding the result of one to another via vi.method(vj.result()) is permitted. Scala 3 uses applyN2..5 macros (rather than transparent inline + summonFrom) to avoid a type-intersection bug that prevented explicit $[B] annotations on non-Unscoped results. Scala 2 uses a shared useNImpl whitebox macro. Also fixes four pre-existing bugs in the N=1 macro (Scala 3): - While/Try/Return nodes fell through to case _ => () in traverseTerm and checkNoCapture, allowing param leaks inside loop bodies and catch branches - ClassDef (anonymous class) was not traversed, allowing params to be captured in inner Runnable/Callable bodies - NamedArg was not traversed, allowing fn(arg = d) to bypass the check - Assign LHS was not traversed (d.field = expr was silently passed) Error messages now name the offending parameter by index and source name: Parameter 2 ('conn') cannot be passed as an argument to a function or method. Tests: 346 pass on Scala 3, 344 on Scala 2 (cross-platform JVM + JS). * fix(scope): correct scalafmt formatting on Scala 2 source files * fix(scope): address review comments — Scaladoc, test message assertions, docs API reference - Add full @tparam/@param/@return/@example Scaladoc to all N=2..5 $ overloads in both Scala 2 and Scala 3 ScopeVersionSpecific - Restore message-content assertions to ScopeSpec negative tests (containsString checks for 'cannot'/'Cyclic reference'/'Parameter'/'Unsafe use') - Expand N=4/N=5 API reference signatures in docs/scope.md to full parameter lists instead of (…) placeholders
Refactor XML codec derivation to minimize `Lazy#force` calls + more e… …fficient and safe XNK decoding + code cleanup + bump up test coverage limits (#1140) * Refactor XML codec derivation to minimize `Lazy#force` calls + code clean up + bump up test coverage limits * Fix doc reference * Revert `xmlAttribute` renaming
PreviousNext