Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ the bottom of this file. Restoration ships incrementally per feature area.

## 1. Will not migrate

| Symbol/module | Rationale |
|-------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `commons-macros` module | Pure Scala 2 macro infrastructure (`c.universe`, blackbox/whitebox). No Scala 3 surface worth porting; Scala 3 uses inline + quotes which is a structural redesign. Module deleted outright in Phase 1. |
| `analyzer` module | Scala 2 compiler plugin; would require a full Scala 3 compiler plugin rewrite. Restored only if downstream demand surfaces. |
| `jetty` module | ee10 servlet wrapper; deprecated upstream. Out of scope until/unless restored. |
| `spring` module | spring-context wiring; deprecated upstream. Module deleted outright in Phase 1. |
| `comprof` module | `scalac-profiling` plugin is Scala 2 only. Retire pending a Scala 3 alternative. |
| `-Xsource:3` scalac flag | Obsolete — the codebase IS Scala 3 now. |
| `-Wconf` warning suppression blocks | Project rule: fix warnings at source, not via suppression. |
| `-language:experimental.macros` | Scala 3 uses `inline` + `scala.quoted`; flag is a no-op. |
| Scala 2 macro impls (`c.universe`, blackbox/whitebox) | Replaced by Scala 3 quotes/inline during feature-area restoration; the legacy `commons-macros` module is gone. |
| Symbol/module | Rationale |
|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `commons-macros` module | Pure Scala 2 macro infrastructure (`c.universe`, blackbox/whitebox). No Scala 3 surface worth porting; Scala 3 uses inline + quotes which is a structural redesign. Module deleted outright in Phase 1. |
| `analyzer` module | Scala 2 compiler plugin; would require a full Scala 3 compiler plugin rewrite. Restored only if downstream demand surfaces. |
| `jetty` module | ee10 servlet wrapper; deprecated upstream. Out of scope until/unless restored. |
| `spring` module | spring-context wiring; deprecated upstream. Module deleted outright in Phase 1. |
| `comprof` module | `scalac-profiling` plugin is Scala 2 only. Retire pending a Scala 3 alternative. |
| `-Xsource:3` scalac flag | Obsolete — the codebase IS Scala 3 now. |
| `-Wconf` warning suppression blocks | Project rule: fix warnings at source, not via suppression. |
| `-language:experimental.macros` | Scala 3 uses `inline` + `scala.quoted`; flag is a no-op. |
| Scala 2 macro impls (`c.universe`, blackbox/whitebox) | Replaced by Scala 3 quotes/inline during feature-area restoration; the legacy `commons-macros` module is gone. |
| `com.avsystem.commons.misc.Implicits` object | Scala 2 macro helpers `infer` / `inferNonMacro` — covered by `scala.compiletime.summon[T]`. Object deleted outright. |
| `com.avsystem.commons.misc.ImplicitNotFound` sealed trait | Scala 2 diagnostic hack: the `@implicitNotFound` message was itself resolved via implicit search, allowing composed error messages (`#{forNotLazy}` / `#{forPlain}` interpolation). No Scala 3 equivalent — `@implicitNotFound` is supported natively but message composition via implicit search is not. Trait deleted outright; dependent diagnostic-only defs removed (`MetadataCompanion.Lazy.notFound`, `BoundedMetadataCompanion.Lazy.notFound`, `AsRaw.notFoundForTry`, `AsReal.notFoundForTry`). Functionality unaffected — these only customized compiler error messages. `ImplicitNotFoundTest` deleted. |

## 2. Deprecated on Scala 3

Expand Down Expand Up @@ -101,7 +103,7 @@ with no surviving partners. Six broken-test categories:
`MongoIndexTest`, `MongoOrderTest`, `MongoProjectionTest`, `MongoRefTest`, `MongoUpdateTest`,
`TypedMongoCollectionTest`, `testEntities`.
- **Hocon derivation** — `hocon/.../*.scala` (2 files): `HoconInputTest`, `HoconGenCodecRoundtripTest`.
- **Misc derivation** — `ImplicitNotFoundTest`, `MacroInstancesTest`, `CompilationErrorAssertions`.
- **Misc derivation** — `MacroInstancesTest`, `CompilationErrorAssertions`.

Full per-file list with locations is in the Backlog table below (filter rows where Location contains `/src/test/`).

Expand Down Expand Up @@ -223,7 +225,6 @@ Full per-file list with locations is in the Backlog table below (filter rows whe
| `core/src/test/scala/com/avsystem/commons/macros/KnownSubtypesTest.scala:4` | KnownSubtypesTest — depends on TestMacros / scala-2 `def ... = macro ...` | L |
| `core/src/test/scala/com/avsystem/commons/macros/TreeForTypeTest.scala:4` | TreeForTypeTest — depends on TestMacros / scala-2 `def ... = macro ...` | L |
| `core/src/test/scala/com/avsystem/commons/macros/TypeStringTest.scala:4` | TypeStringTest — depends on TestMacros / scala-2 `def ... = macro ...` | L |
| `core/src/test/scala/com/avsystem/commons/misc/ImplicitNotFoundTest.scala:4` | ImplicitNotFoundTest — depends on stubbed materialize/derivation APIs | M |
| `core/src/test/scala/com/avsystem/commons/misc/MacroInstancesTest.scala:4` | MacroInstancesTest — depends on stubbed materialize/derivation APIs | M |
| `core/src/test/scala/com/avsystem/commons/serialization/CodecTestData.scala:4` | CodecTestData — depends on stubbed materialize/derivation APIs | M |
| `core/src/test/scala/com/avsystem/commons/serialization/GenCodecRoundtripTest.scala:4` | GenCodecRoundtripTest — depends on stubbed materialize/derivation APIs | M |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package com.avsystem.commons
package meta

import com.avsystem.commons.misc.ImplicitNotFound

import scala.annotation.implicitNotFound

/** Base trait for companion objects of _metadata classes_. A metadata class is a generic class that captures metadata
* for some Scala type, typically an RPC interface ([[com.avsystem.commons.rpc.RpcMetadataCompanion
* RpcMetadataCompanion]]) or a data type ([[AdtMetadataCompanion]]).
Expand All @@ -26,10 +22,6 @@ trait MetadataCompanion[M[_]] {
// macro effectively turns `metadata` param into by-name param (implicit params by themselves cannot be by-name)
// TODO[scala3-port]: lazyMetadata (Scala 2 macro def) (L)
implicit def lazyMetadata[Real](implicit metadata: M[Real]): Lazy[Real] = ???

@implicitNotFound("#{forNotLazy}")
implicit def notFound[T](implicit forNotLazy: ImplicitNotFound[M[T]]): ImplicitNotFound[Lazy[T]] =
ImplicitNotFound()
}
}

Expand Down Expand Up @@ -57,9 +49,5 @@ trait BoundedMetadataCompanion[Hi, Lo <: Hi, M[_ >: Lo <: Hi]] {
// macro effectively turns `metadata` param into by-name param (implicit params by themselves cannot be by-name)
// TODO[scala3-port]: lazyMetadata (bounded) (Scala 2 macro def) (L)
implicit def lazyMetadata[Real >: Lo <: Hi](implicit metadata: M[Real]): Lazy[Real] = ???

@implicitNotFound("#{forNotLazy}")
implicit def notFound[T >: Lo <: Hi](implicit forNotLazy: ImplicitNotFound[M[T]]): ImplicitNotFound[Lazy[T]] =
ImplicitNotFound()
}
}
45 changes: 0 additions & 45 deletions core/src/main/scala/com/avsystem/commons/misc/Implicits.scala

This file was deleted.

11 changes: 0 additions & 11 deletions core/src/main/scala/com/avsystem/commons/rpc/AsRawReal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.avsystem.commons
package rpc

import com.avsystem.commons.meta.Fallback
import com.avsystem.commons.misc.ImplicitNotFound
import com.avsystem.commons.serialization.TransparentWrapping

import scala.annotation.implicitNotFound
Expand Down Expand Up @@ -32,11 +31,6 @@ object AsRaw extends FallbackAsRaw {
implicit def identity[A]: AsRaw[A, A] = AsRawReal.identity[A]
implicit def forTry[Raw, Real](implicit asRaw: AsRaw[Raw, Real]): AsRaw[Try[Raw], Try[Real]] =
_.map(asRaw.asRaw)

@implicitNotFound("#{forPlain}")
implicit def notFoundForTry[Raw, Real](
implicit forPlain: ImplicitNotFound[AsRaw[Raw, Real]]
): ImplicitNotFound[AsRaw[Try[Raw], Try[Real]]] = ImplicitNotFound()
}
trait FallbackAsRaw { this: AsRaw.type =>
implicit def fromFallback[Raw, Real](implicit fallback: Fallback[AsRaw[Raw, Real]]): AsRaw[Raw, Real] =
Expand Down Expand Up @@ -65,11 +59,6 @@ object AsReal extends FallbackAsReal {
implicit def identity[A]: AsReal[A, A] = AsRawReal.identity[A]
implicit def forTry[Raw, Real](implicit asReal: AsReal[Raw, Real]): AsReal[Try[Raw], Try[Real]] =
_.map(asReal.asReal)

@implicitNotFound("#{forPlain}")
implicit def notFoundForTry[Raw, Real](
implicit forPlain: ImplicitNotFound[AsReal[Raw, Real]]
): ImplicitNotFound[AsReal[Try[Raw], Try[Real]]] = ImplicitNotFound()
}
trait FallbackAsReal { this: AsReal.type =>
implicit def fromFallback[Raw, Real](implicit fallback: Fallback[AsReal[Raw, Real]]): AsReal[Raw, Real] =
Expand Down

This file was deleted.

Loading