Skip to content

Commit

Permalink
dirty fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Sep 28, 2024
1 parent f6b0309 commit 03d0a9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import smithy4s.schema.Schema.string
object HasUnionUnitCaseTrait extends Newtype[String] {
val id: ShapeId = ShapeId("smithy4s.example", "HasUnionUnitCaseTrait")
val hints: Hints = Hints(
smithy4s.example.UnionTraitWithUnitCase.UCase(()).widen,
smithy4s.example.UnionTraitWithUnitCase.UCase.widen,
).lazily
val underlyingSchema: Schema[String] = string.withId(id).addHints(hints)
implicit val schema: Schema[HasUnionUnitCaseTrait] = bijection(underlyingSchema, asBijection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,13 @@ private[internals] class Renderer(compilationUnit: CompilationUnit) { self =>
})

case AltTN(ref, altName, AltValueTN.TypeAltTN(alt)) =>
line"${ref.show}.${altName.capitalize}Case(${alt.runDefault}).widen".write
val justParens = line"()"
val constructorCall = alt.runDefault match {
case `justParens` => Line.empty
case more => line"($more)"
}

line"${ref.show}.${altName.capitalize}Case$constructorCall.widen".write

case AltTN(_, _, AltValueTN.ProductAltTN(alt)) =>
alt.runDefault.write
Expand Down

0 comments on commit 03d0a9d

Please sign in to comment.