Skip to content

Commit

Permalink
Document evidence types and suppress their coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKubuszok committed Apr 10, 2024
1 parent 9cc0a6a commit b71778f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ package io.scalaland.chimney.internal.runtime

import scala.annotation.{implicitNotFound, unused}

// $COVERAGE-OFF$evidence used only within macro-erased expressions

/** Allow us to provide `.everyItem` extension method only for the types where macros would actually handle it.
*
* @since 1.0.0
*/
@implicitNotFound(
"Expected collection (type extending scala.Iterable which has scala.collection.compat.Factory instance), got ${C}"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ package io.scalaland.chimney.internal.runtime

import scala.annotation.implicitNotFound

// $COVERAGE-OFF$evidence used only within macro-erased expressions

/** Allow us to provide `.matchingLeft` and `.matchingRight` extension methods only for the types where macros would
* actually handle it.
*
* @since 1.0.0
*/
@implicitNotFound("Expected Either (type extending scala.Either), got ${E}")
sealed trait IsEither[E] {
type LeftValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ package io.scalaland.chimney.internal.runtime

import scala.annotation.{implicitNotFound, unused}

// $COVERAGE-OFF$evidence used only within macro-erased expressions

/** Allow us to provide `.everyMapKey` and `.everyMapValue` extension methods only for the types where macros would
* actually handle it.
*
* @since 1.0.0
*/
@implicitNotFound(
"Expected map (type extending scala.collection.immutable.Map which has scala.collection.compat.Factory instance), got ${M}"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ package io.scalaland.chimney.internal.runtime

import scala.annotation.implicitNotFound

// $COVERAGE-OFF$evidence used only within macro-erased expressions

/** Allow us to provide `.matchingSome` extension method only for the types where macros would actually handle it.
*
* @since 1.0.0
*/
@implicitNotFound("Expected Option (type extending scala.Option), got ${O}")
sealed trait IsOption[O] {
type SomeValue
Expand Down

0 comments on commit b71778f

Please sign in to comment.