Skip to content

Commit 9fdd145

Browse files
author
Roman Janusz
committed
more improvements
1 parent bbb6111 commit 9fdd145

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

commons-mongo/jvm/src/main/scala-2.13/com/avsystem/commons/mongo/typed/MongoPolyDataCompanion.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ trait MongoPolyAdtInstances[D[_]] {
1212
def codec[T: GenCodec]: GenObjectCodec[D[T]]
1313

1414
/**
15-
* We need to accept an implicit `GenObjectCodec[D[T]]` because materialization of
16-
* [[MongoAdtFormat]] requires it ([[MongoAdtFormat.codec]]). In practice, it can be derived
17-
* from the `MongoFormat[T]` that is already accepted by this method but we don't want to do this in this
18-
* trait to avoid problems with priorities of implicits. Because of that, this implicit is actually constructed
19-
* by [[AbstractMongoPolyDataCompanion.format]].
15+
* We need to accept an implicit `GenCodec[T]` because materialization of
16+
* [[MongoAdtFormat]] requires a [[GenObjectCodec]] ([[MongoAdtFormat.codec]]). In practice, it can be derived
17+
* from the `MongoFormat[T]` that is already accepted by this method but we have to be careful about priority of
18+
* implicits. Because of that, this implicit is actually provided by [[AbstractMongoPolyDataCompanion.format]].
2019
*/
21-
def format[T: MongoFormat](implicit codec: GenObjectCodec[D[T]]): MongoAdtFormat[D[T]]
20+
def format[T: MongoFormat : GenCodec]: MongoAdtFormat[D[T]]
2221
}
2322

2423
abstract class AbstractMongoPolyDataCompanion[Implicits, D[_]](implicits: Implicits)(

commons-mongo/jvm/src/test/scala-2.13/com/avsystem/commons/mongo/typed/PolyDataWithCustomImplicits.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ abstract class CustomPolyDataCompanion[D[_]](
1919
* This class tests (through its compilation) if implicit resolution conflicts that were
2020
* previously present in [[MongoPolyAdtInstances]] are fixed.
2121
*/
22-
case class PolyDataWithCustomImplicits[+T](wrappy: CustomWrappy, value: T)
22+
case class PolyDataWithCustomImplicits[+T](wrappy: CustomWrappy, value: List[T])
2323
object PolyDataWithCustomImplicits extends CustomPolyDataCompanion[PolyDataWithCustomImplicits]

0 commit comments

Comments
 (0)