tapir icon indicating copy to clipboard operation
tapir copied to clipboard

[BUG] method `schemaForCaseClass` is declared as erased, but is in fact used

Open Centaur opened this issue 3 years ago • 4 comments

Tapir version: 0.19.1+

Scala version: 3.1.0

Describe the bug

What is the problem? mysterious compile errors

method isValueClass is declared as erased, but is in fact used
method isObject is declared as erased, but is in fact used
method schemaForCaseClass is declared as erased, but is in fact used
method anns is declared as erased, but is in fact used
method typeInfo is declared as erased, but is in fact used
method typeAnns is declared as erased, but is in fact used
method getParams is declared as erased, but is in fact used
method summon is declared as erased, but is in fact used

How to reproduce?

Maybe you can provide code to reproduce the problem? https://scastie.scala-lang.org/Fy5fl0keRXWtP8i5bSCymA

Additional information If reduce field numbe of case class StandardAreaInfo or TwinNode by 1,for example, comment country:String or city:String, or realSceneID:UUID or coverImage:Option[String] , the errors disappears

Centaur avatar Jan 05 '22 03:01 Centaur

I have the same Problem: Tapir version: 0.18.3 Scala version: 3.1.0

To a certain point I could work around this problem with

    scalacOptions ++= Seq(
      "-Xmax-inlines",
      "50" // is declared as erased, but is in fact used
    )

Compiling gets really slow though.

I got this from here https://github.com/lampepfl/dotty/issues/13044

Maybe this is related.

pme123 avatar Jan 10 '22 15:01 pme123

Same issue here, however I worked around it by using Schema.derived[T]

ahjohannessen avatar Jan 11 '22 16:01 ahjohannessen

See https://github.com/softwaremill/magnolia/issues/374 - a bit minimized, but still mysterious

adamw avatar Jan 24 '22 17:01 adamw

@Centaur your particular problem is solved by bumping max-inlines as @pme123 suggested (thanks!). Question remains, can we do something in magnolia about it, or maybe Scala should bump the inlining limit. These classes aren't that complicated

adamw avatar Jan 25 '22 11:01 adamw