Skip to content

Commit eca7730

Browse files
committed
Only emit show instances for data types with at least 1 constructor
1 parent 1a41a27 commit eca7730

File tree

1 file changed

+1
-1
lines changed
  • effekt/shared/src/main/scala/effekt/core

1 file changed

+1
-1
lines changed

effekt/shared/src/main/scala/effekt/core/Show.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ object Show extends Phase[CoreTransformed, CoreTransformed] {
201201
declarations flatMap generateShowInstance
202202

203203
def generateShowInstance(decl: Declaration)(using ctx: ShowContext)(using DeclarationContext): Option[Toplevel.Def] = decl match {
204-
case dataDecl: Declaration.Data =>
204+
case dataDecl: Declaration.Data if dataDecl.constructors.size > 0 =>
205205
val freshId = freshShowId
206206
val toplevel = generateShowInstance(dataDecl, freshId)
207207
ctx.showDefns += (ValueType.Data(dataDecl.id, List.empty) -> freshId)

0 commit comments

Comments
 (0)