Skip to content

deprecate ValueOf in favor of standard library scala.ValueOf#832

Open
halotukozak wants to merge 4 commits intoadd-mima-testfrom
deprecate-value-of
Open

deprecate ValueOf in favor of standard library scala.ValueOf#832
halotukozak wants to merge 4 commits intoadd-mima-testfrom
deprecate-value-of

Conversation

@halotukozak
Copy link
Copy Markdown
Member

Scala has already native support for ValueOf

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 its apply) as deprecated and add local @nowarn suppressions for deprecation noise in tests.
  • Switch some internal usages from com.avsystem.commons.misc.ValueOf to scala.ValueOf by removing the old import.
  • Update AdtMetadataTest singleton metadata to use scala.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.

Comment thread core/src/main/scala/com/avsystem/commons/misc/ValueOf.scala
Comment thread core/src/main/scala/com/avsystem/commons/serialization/cbor/CborAdtMetadata.scala Outdated
Comment thread core/src/test/scala/com/avsystem/commons/misc/AdtMetadataTest.scala
@halotukozak halotukozak removed the request for review from ddworak April 15, 2026 12:55
@halotukozak halotukozak changed the base branch from master to add-mima-test April 16, 2026 15:53
halotukozak and others added 4 commits April 16, 2026 18:04
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>
@halotukozak halotukozak requested a review from ddworak April 16, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants