/claim #514

Summary

This PR implements annotation macros for generating optics and schema instances in zio-blocks, as specified in issue #514.

Scala 2.13 Implementation

@optics Annotation

Generates a Lens for each field of a case class in the companion object.

@optics_ Annotation

Same as @optics but prefixes all optics with underscore to avoid name collisions.

@deriveSchema Annotation

Generates an implicit Schema instance in the companion object.

Scala 3.5+ Note

Due to a documented limitation in Scala 3’s MacroAnnotation API, the recommended patterns for Scala 3 are using derives Schema and CompanionOptics.

Test Results

  • Scala 2.13: All 602 tests passing
  • Scala 3.3.7: All 643 tests passing
  • Scala 3.7.4 (scalaNextTests): 4 new tests passing

Demo Video

  1. https://github.com/user-attachments/assets/283b38a1-7a24-4ac3-9364-b331904679f9

  2. https://github.com/user-attachments/assets/524fb129-69e3-4086-843f-e7b80b9a26af

Claim

Total prize pool $2,000
Total paid $0
Status Pending
Submitted December 20, 2025
Last updated December 20, 2025

Contributors

NA

Natneal.B

@natinew77-creator

100%

Sponsors

ZI

ZIO

@ZIO

$2,000