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
Original file line number Diff line number Diff line change
Expand Up @@ -650,15 +650,11 @@ class ProtobufGenerator(
})
}

private def composeGen(funcs: Seq[String], emitScala3Sources: Boolean) = {
private def composeGen(funcs: Seq[String]) = {
if (funcs.length == 1) {
funcs(0)
} else {
if (emitScala3Sources) {
s"(${funcs(0)})" + funcs.tail.map(func => s".compose($func)").mkString
} else {
s"(${funcs(0)} _)" + funcs.tail.map(func => s".compose($func)").mkString
}
s"(${funcs(0)}(_))" + funcs.tail.map(func => s".compose($func)").mkString
}
}

Expand All @@ -684,8 +680,7 @@ class ProtobufGenerator(
if (field.customSingleScalaTypeName.isDefined)
Seq(s"${field.typeMapper.fullName}.toBase")
else Nil
),
message.getFile.emitScala3Sources
)
)

printer.add(s"""if (${field.collection.nonEmptyCheck(fieldNameSymbol)}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final case class EnumVector(
if (colors.nonEmpty) {
_output__.writeTag(1, 2)
_output__.writeUInt32NoTag(colorsSerializedSize)
colors.foreach((_output__.writeEnumNoTag _).compose((_: _root_.scalapb.perf.protos.Color).value))
colors.foreach((_output__.writeEnumNoTag(_)).compose((_: _root_.scalapb.perf.protos.Color).value))
};
unknownFields.writeTo(_output__)
}
Expand Down
10 changes: 5 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ object Dependencies {
val mockito = "5.21.0"
val munit = "1.2.0"
val scalaTest = "3.2.19"
val scalaTestPlusMockito = "3.1.0.0"
val scalaTestPlusScalaCheck = "3.2.18.0"
val scalaTestPlusMockito = "3.2.19.0"
val scalaTestPlusScalaCheck = "3.2.19.0"
val utest = "0.7.10"
}

val Scala212 = "2.12.19"

val Scala213 = "2.13.16"
val Scala213 = "2.13.18"

val Scala3 = "3.3.7"

Expand Down Expand Up @@ -57,9 +57,9 @@ object Dependencies {
// testing
val scalaTest = Def.setting { "org.scalatest" %%% "scalatest" % versions.scalaTest }
val scalaTestPlusScalaCheck = Def.setting {
"org.scalatestplus" %%% "scalacheck-1-17" % versions.scalaTestPlusScalaCheck
"org.scalatestplus" %%% "scalacheck-1-18" % versions.scalaTestPlusScalaCheck
}
val scalaTestPlusMockito = "org.scalatestplus" %% "mockito-1-10" % versions.scalaTestPlusMockito
val scalaTestPlusMockito = "org.scalatestplus" %% "mockito-5-12" % versions.scalaTestPlusMockito
val utest = Def.setting { "com.lihaoyi" %%% "utest" % versions.utest }
val munit = Def.setting { "org.scalameta" %%% "munit" % versions.munit }
val munitScalaCheck = Def.setting { "org.scalameta" %%% "munit-scalacheck" % versions.munit }
Expand Down