From 35f6eaca0e620bea84378aca001bedd06a8e2f56 Mon Sep 17 00:00:00 2001 From: Derek Wickern Date: Tue, 11 Jun 2024 14:00:39 -0700 Subject: [PATCH] use simple typeable for simple case classes --- .../typeable/src/main/scala/shapeless3/typeable/typeable.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/typeable/src/main/scala/shapeless3/typeable/typeable.scala b/modules/typeable/src/main/scala/shapeless3/typeable/typeable.scala index bbfa547..bf2b75c 100644 --- a/modules/typeable/src/main/scala/shapeless3/typeable/typeable.scala +++ b/modules/typeable/src/main/scala/shapeless3/typeable/typeable.scala @@ -383,10 +383,10 @@ object TypeableMacros: val owner = normalizeModuleClass(sym.owner) qual match - case Some(_) if sym.flags.is(Flags.Case) => mkCaseClassTypeable case None => mkNamedSimpleTypeable case Some(tp: TypeRef) if normalizeModuleClass(tp.typeSymbol) == owner => mkNamedSimpleTypeable case Some(tp: TermRef) if normalizeModuleClass(tp.termSymbol) == owner => mkNamedSimpleTypeable + case Some(_) if sym.flags.is(Flags.Case) => mkCaseClassTypeable case Some(_) if sym.flags.is(Flags.Sealed) => mkSumTypeable case _ => report.errorAndAbort(s"No Typeable for type ${target.show} with a dependent prefix")