Skip to content

Commit

Permalink
unify implicit name across Scala versions
Browse files Browse the repository at this point in the history
  • Loading branch information
yakivy committed Dec 8, 2023
1 parent 340ac20 commit 44c3bdc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
18 changes: 3 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Put cats and poppet dependencies in the build file, let's assume you are using S
val version = new {
val cats = "2.10.0"
val circe = "0.14.6"
val poppet = "0.3.4"
val poppet = "0.3.5"
}

libraryDependencies ++= Seq(
Expand Down Expand Up @@ -235,28 +235,16 @@ Provider[..., ...]()

### Changelog

#### 0.3.4:
#### 0.3.x:
- fix compilation errors for methods with varargs

#### 0.3.3:
- fix several compilation errors for Scala 3

#### 0.3.2:
- fix codec resolution for id (`I => I`) codecs

#### 0.3.1:
- reset `DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES` jackson object mapping property to default value to close [DoS vulnerability](https://github.com/FasterXML/jackson-module-scala/issues/609)

#### 0.3.0:
- add Scala 3 support

#### 0.2.2:
#### 0.2.x:
- fix compilation error message for ambiguous implicits

#### 0.2.1:
- fix processor compilation for complex types

#### 0.2.0:
- migrate to mill build tool
- add Scala JS and Scala Native support
- add more details to `Can't find processor` exception
Expand Down
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import mill.playlib._
import com.github.lolgab.mill.crossplatform._

object versions {
val publish = "0.3.4"
val publish = "0.3.5"

val scala212 = "2.12.18"
val scala213 = "2.13.12"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import scala.quoted.*
import scala.compiletime.*

trait ConsumerProcessorObjectBinCompat {
implicit inline def apply[F[_], I, S](implicit inline MF: Monad[F]): ConsumerProcessor[F, I, S] =
implicit inline def generate[F[_], I, S](implicit inline MF: Monad[F]): ConsumerProcessor[F, I, S] =
${ ConsumerProcessorObjectBinCompat.processorExpr('MF) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import scala.quoted.*
import scala.compiletime.*

trait ProviderProcessorObjectBinCompat {
implicit inline def apply[F[_], I, S](implicit inline MF: Monad[F]): ProviderProcessor[F, I, S] =
implicit inline def generate[F[_], I, S](implicit inline MF: Monad[F]): ProviderProcessor[F, I, S] =
${ ProviderProcessorObjectBinCompat.processorExpr('MF) }
}

Expand Down
2 changes: 1 addition & 1 deletion core/test/src/poppet/consumer/ConsumerProcessorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ConsumerProcessorSpec extends AsyncFreeSpec with ProcessorSpec {
Response("0")
}
"for methods with different arguments number" in {
val a = ConsumerProcessor[Id, String, Simple].apply(client, FailureHandler.throwing)
val a = ConsumerProcessor.generate[Id, String, Simple].apply(client, FailureHandler.throwing)

assert(a.a0 == 0 && request == Request[String](
"poppet.core.ProcessorSpec.Simple",
Expand Down
2 changes: 1 addition & 1 deletion core/test/src/poppet/provider/ProviderProcessorSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ProviderProcessorSpec extends AsyncFreeSpec with ProcessorSpec {

"when has id data kind" - {
"for methods with different arguments number" in {
val p = ProviderProcessor[Id, String, Simple].apply(simpleImpl, FailureHandler.throwing)
val p = ProviderProcessor.generate[Id, String, Simple].apply(simpleImpl, FailureHandler.throwing)

assert(p(0).service == "poppet.core.ProcessorSpec.Simple"
&& p(0).name == "a0" && p(0).arguments == List.empty
Expand Down

0 comments on commit 44c3bdc

Please sign in to comment.