Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
a.valentinov committed May 21, 2023
1 parent ea375bb commit 72a8dc0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Scala 2.12, 2.13 and 3 are supported. See [Supported Scala versions](#supported-
Add phobos-core to your dependencies:

```
libraryDependencies += "ru.tinkoff" %% "phobos-core" % "0.20.0"
libraryDependencies += "ru.tinkoff" %% "phobos-core" % "0.21.0"
```

Then try this code out in `sbt console` or in a separate source file:
Expand Down Expand Up @@ -66,7 +66,7 @@ Performance details can be found out in [phobos-benchmark repository](https://gi
There are several additional modules for some specific cases.
These modules could be added with command below:
```
libraryDependencies += "ru.tinkoff" %% "phobos-<module>" % "0.20.0"
libraryDependencies += "ru.tinkoff" %% "phobos-<module>" % "0.21.0"
```
Where `<module>` is module name.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ object common {
val traitTypeRepr = TypeRepr.of[T]
val traitSymbol = traitTypeRepr.typeSymbol

val names = Varargs(traitSymbol.children.map { childInfosymbol =>
extractChildXmlName(using q)(config, traitSymbol, childInfosymbol)
val names = Varargs(traitSymbol.children.map { childInfoSymbol =>
extractChildXmlName(using q)(config, traitSymbol, childInfoSymbol)
})
'{ List($names: _*) }
}
Expand Down Expand Up @@ -206,18 +206,18 @@ object common {
private def extractChildXmlName(using Quotes)(
config: Expr[ElementCodecConfig],
traitSymbol: quotes.reflect.Symbol,
childInfosymbol: quotes.reflect.Symbol,
childInfoSymbol: quotes.reflect.Symbol,
): Expr[String] = {
import quotes.reflect.*
childInfosymbol.annotations.map(_.asExpr).collect { case '{ discriminator($a) } => a } match {
case Nil => '{ $config.transformConstructorNames(${ Expr(childInfosymbol.name) }) }
childInfoSymbol.annotations.map(_.asExpr).collect { case '{ discriminator($a) } => a } match {
case Nil => '{ $config.transformConstructorNames(${ Expr(childInfoSymbol.name) }) }
case List(name) => name
case names =>
val discriminatorAnnotations = names.map(name => s"@discriminator(${name.show})").mkString(", ")
report.throwError(
s"""
|Sum type child cannot have more than one @discriminator annotation.
|Child '${childInfosymbol.name}' of sum type '${traitSymbol.name}' has ${names.size}: $discriminatorAnnotations
|Child '${childInfoSymbol.name}' of sum type '${traitSymbol.name}' has ${names.size}: $discriminatorAnnotations
|""".stripMargin,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1696,4 +1696,3 @@ class DecoderDerivationTest extends AnyWordSpec with Matchers {
}
}
}

2 changes: 1 addition & 1 deletion publish.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Publish._

publishVersion := "0.20.0"
publishVersion := "0.21.0"

ThisBuild / organization := "ru.tinkoff"
ThisBuild / version := {
Expand Down

0 comments on commit 72a8dc0

Please sign in to comment.