prev: #648
Stringly-typed API in Scala 2 which is NOT source-compatible with typed API in Scala 3
Fixed. I removed all “stringly-typed” convenience methods (e.g., addField("name", ...)) from the public API.
renameField(from: A => Any, to: B => Any).There is no compile-time validation… weak System.err support…
Fixed.
Compile-Time Validation (Scala 2 & 3): I implemented comprehensive macros for BOTH platforms (MigrationBuilderValidation for Scala 3, MigrationBuilderMacros for Scala 2) that perform deep AST traversal of the builder chain. They statically verify that:
Result: Incomplete migrations now fail to compile with clear error messages (e.g.,
Migration incomplete: target fields [age] are not produced).
Runtime Safety: I completely removed System.err.println. The runtime validation (used by Scala 2 or as a backup) now throws distinct exceptions (IllegalStateException) if a migration is invalid, ensuring visible failures.
No support for structural types… This work should not include the Schema#structural macro
Addressed.
StructuralSchemaDerivation.scala and all related macro code from this PR.Schema[A] resolution (e.g., case classes). This allowed me to implement strict compile-time validation, which is much more reliable on concrete types. Once the structural macro is implemented in a separate PR, this system is designed to support it via the standard Schema interface.SchemaError)Probably should use / expand SchemaError instead of MigrationError
Fixed. I deleted MigrationError entirely.
MigrationAction, DynamicMigration, Migration) now return Either[SchemaError, A].SchemaError./claim #519
Jash Ambaliya
@AJ0070
ZIO
@ZIO