Skip to content

Commit c5990d2

Browse files
committed
Fix compilation under JDK17
1 parent d786717 commit c5990d2

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

commons-macros/src/main/scala/com/avsystem/commons/macros/MacroCommons.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ trait MacroCommons extends CompatMacroCommons { bundle =>
10511051
actualParamType(param.typeSignature)
10521052

10531053
def actualParamType(tpe: Type): Type = tpe match {
1054-
case TypeRef(_, s, List(arg)) if s == definitions.RepeatedParamClass =>
1054+
case TypeRef(_, s, List(arg)) if s == definitions.RepeatedParamClass || s == definitions.JavaRepeatedParamClass =>
10551055
getType(tq"$ScalaPkg.Seq[$arg]")
10561056
case TypeRef(_, s, List(arg)) if s == definitions.ByNameParamClass =>
10571057
arg
@@ -1409,17 +1409,26 @@ trait MacroCommons extends CompatMacroCommons { bundle =>
14091409
}
14101410
}
14111411

1412-
def determineTypeParams(undetTpe: Type, detTpe: Type, typeParams: List[Symbol]): Option[List[Type]] = {
1412+
def determineTypeParams(undetTpe: Type, detTpe: Type, typeParams: List[Symbol], debug: Boolean = false): Option[List[Type]] = {
14131413
val methodName = c.freshName(TermName("m"))
14141414
val typeDefs = typeParams.map(typeSymbolToTypeDef(_, forMethod = true))
14151415

1416+
if(debug) {
1417+
q"""
1418+
def $methodName[..$typeDefs](f: ${treeForType(undetTpe)} => $UnitCls): $UnitCls = ()
1419+
$methodName((_: $detTpe) => ())
1420+
""".debug("")
1421+
}
1422+
14161423
val tree = typecheck(
14171424
q"""
14181425
def $methodName[..$typeDefs](f: ${treeForType(undetTpe)} => $UnitCls): $UnitCls = ()
14191426
$methodName((_: $detTpe) => ())
14201427
""", silent = true
14211428
)
14221429

1430+
if(debug) println(tree)
1431+
14231432
tree match {
14241433
case Block(_, Apply(TypeApply(_, args), _)) => Some(args.map(_.tpe))
14251434
case Block(_, Apply(_, _)) => Some(Nil)

commons-redis/src/main/scala/com/avsystem/commons/redis/commands/streams.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ object XEntryId {
398398
CommandArg((enc, eid) => enc.add(eid.toString))
399399
}
400400

401-
case class XEntry[Record](id: XEntryId, data: Record)
401+
case class XEntry[Rec](id: XEntryId, data: Rec)
402402

403403
case class XMaxlen(maxlen: Long, approx: Boolean = true)
404404
object XMaxlen {

0 commit comments

Comments
 (0)