deprecate ValueOf in favor of standard library scala.ValueOf#832
Open
halotukozak wants to merge 4 commits intoadd-mima-testfrom
Open
deprecate ValueOf in favor of standard library scala.ValueOf#832halotukozak wants to merge 4 commits intoadd-mima-testfrom
ValueOf in favor of standard library scala.ValueOf#832halotukozak wants to merge 4 commits intoadd-mima-testfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Deprecates the project-specific com.avsystem.commons.misc.ValueOf typeclass in favor of the standard library scala.ValueOf, and updates some code/tests accordingly.
Changes:
- Mark
misc.ValueOf(and itsapply) as deprecated and add local@nowarnsuppressions for deprecation noise in tests. - Switch some internal usages from
com.avsystem.commons.misc.ValueOftoscala.ValueOfby removing the old import. - Update
AdtMetadataTestsingleton metadata to usescala.ValueOf.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/test/scala/com/avsystem/commons/misc/ValueOfTest.scala | Suppresses deprecation warnings for tests that still validate the deprecated misc.ValueOf behavior. |
| core/src/test/scala/com/avsystem/commons/misc/AdtMetadataTest.scala | Uses scala.ValueOf for singleton case metadata and adjusts imports. |
| core/src/main/scala/com/avsystem/commons/serialization/cbor/CborAdtMetadata.scala | Removes misc.ValueOf import so unqualified ValueOf resolves to scala.ValueOf. |
| core/src/main/scala/com/avsystem/commons/serialization/HasGenCodec.scala | Removes misc.ValueOf import so unqualified ValueOf resolves to scala.ValueOf. |
| core/src/main/scala/com/avsystem/commons/misc/ValueOf.scala | Deprecates misc.ValueOf and ValueOf.apply. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
307738f to
dcb8b78
Compare
Scala 2.13 provides `scala.ValueOf[T]` natively with compiler
auto-materialization for singleton types, making the custom
macro-materialized typeclass redundant. Internal call sites in the
serialization layer migrated to `scala.ValueOf`; `ValueOfTest` keeps
the deprecated API under test via `@nowarn("cat=deprecation")` until
removal.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dcb8b78 to
de920b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scala has already native support for ValueOf