This repository has been archived by the owner on Jul 25, 2023. It is now read-only.
forked from julien-lafont/protoless
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure generic module to make tests compile (and pass)
- Loading branch information
Showing
12 changed files
with
116 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
modules/generic/src/main/scala/io/protoless/generic/IncrementalDecoderInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package io.protoless.generic | ||
|
||
trait IncrementalDecoderInstances { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 9 additions & 4 deletions
13
...g/internal/SemiAutoEncoderInstances.scala → ...ric/SemiAutoEncoderDecoderInstances.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
package io.protoless.generic.encoding.internal | ||
package io.protoless.generic | ||
|
||
import shapeless.Nat | ||
|
||
import io.protoless.generic.encoding.IncrementalEncoderInstances | ||
import io.protoless.messages.Encoder | ||
import io.protoless.messages.{Encoder, Decoder} | ||
import io.protoless.messages.encoders.IncrementalEncoder | ||
import io.protoless.messages.decoders.IncrementalDecoder | ||
|
||
/** | ||
* Internal class allowing to restrict automatic derivation of type `A`. | ||
* | ||
* [[SemiAutoEncoder]] can only be retrieved with `io.protoless.generic.semiauto.deriveEncoder`. | ||
*/ | ||
private[protoless] class SemiAutoEncoder[A](val underlying: Encoder[A]) | ||
private[protoless] class SemiAutoDecoder[A](val underlying: Decoder[A]) | ||
|
||
private[protoless] class SemiAutoEncoderInstances extends IncrementalEncoderInstances { | ||
private[protoless] trait SemiAutoEncoderDecoderInstances extends IncrementalEncoderDecoderInstances { | ||
|
||
implicit def encodeSemiAutoInstance[A](implicit encoder: IncrementalEncoder[A, Nat._1]): SemiAutoEncoder[A] = { | ||
new SemiAutoEncoder[A](encoder) | ||
} | ||
|
||
implicit def decodeSemiAutoInstance[A](implicit decoder: IncrementalDecoder[A, Nat._1]): SemiAutoDecoder[A] = { | ||
new SemiAutoDecoder[A](decoder) | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
...eric/src/main/scala/io/protoless/generic/decoding/internal/SemiAutoDecoderInstances.scala
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
modules/generic/src/main/scala/io/protoless/generic/encoding/AutoEncoderInstances.scala
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
.../generic/src/main/scala/io/protoless/generic/encoding/CustomMappingEncoderInstances.scala
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
...es/generic/src/main/scala/io/protoless/generic/encoding/IncrementalEncoderInstances.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters