Skip to content

Commit

Permalink
Fix #568 - Scala 3 workaround for pattern matching on generic type ~ (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cchantep authored Aug 8, 2023
1 parent 03c75bc commit 7b2bbea
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions core/src/main/scala-3/anorm/macros/RowParserImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,20 @@ private[anorm] object RowParserImpl {
// (whose type has type arguments), false warning is raised
// about exhaustivity.

if (hasGenericProperty) {
List(
ctorCase,
CaseDef(
Wildcard(),
guard = None,
rhs = '{
anorm.Error(
anorm.SqlMappingError(
"Unexpected parsed value: " + ${ parsed }
)
List(
ctorCase,
CaseDef(
Wildcard(),
guard = None,
rhs = '{
anorm.Error(
anorm.SqlMappingError(
"Unexpected parsed value: " + ${ parsed }
)
}.asTerm
)
)
}.asTerm
)
} else {
List(ctorCase)
}
)
}

inline def flatMapParsed[U: Type](inline parsed: Expr[U]): Expr[SqlResult[A]] =
Expand Down

0 comments on commit 7b2bbea

Please sign in to comment.