Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 3 Regression: Unsupported source object for a case class that has a method with the same name as a field #245

Closed
KacperFKorban opened this issue Sep 17, 2024 · 0 comments · Fixed by #246

Comments

@KacperFKorban
Copy link
Collaborator

          @KacperFKorban I'm getting the following error in tapir after updating:
[error] -- Error: /Users/adamw/projects/tapir/docs/openapi-docs/src/test/scalajvm/sttp/tapir/docs/openapi/VerifyYamlTest.scala:847:15
[error] 847 |    docs.modify(_.paths.pathItems)
[error]     |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]     |Unsupported source object: must be a case class or sealed trait, but got: val <none>

Followed by a compiler crash:

[error] ## Exception when compiling 20 sources to /Users/adamw/projects/tapir/docs/openapi-docs/target/jvm-3/test-classes
[error] java.lang.AssertionError: assertion failed
[error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
[error] dotty.tools.dotc.typer.Typer.typedDefDef(Typer.scala:2439)
[error] dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:3026)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3114)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:153)
[error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedUnadapted(Inliner.scala:915)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3187)
[error] dotty.tools.dotc.typer.Typer.typed(Typer.scala:3191)
[error] dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:3213)
[error] dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3259)
[error] dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1161)
[error] dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1165)
[error] dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3058)
[error] dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3115)
[error] dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:153)
[error] dotty.tools.dotc.inlines.Inliner$InlineTyper.typedUnadapted(Inliner.scala:915)
(...)

The definition of .pathItems doesn't look extraordinary:

final case class Paths(
    pathItems: ListMap[String, PathItem] = ListMap.empty,
    extensions: ListMap[String, ExtensionValue] = ListMap.empty
)

Do you maybe have any ideas what could be the cause?

Originally posted by @adamw in #236 (comment)

@KacperFKorban KacperFKorban changed the title Scala 3 Regression: Unsupported source object for normal quicklens usage Scala 3 Regression: Unsupported source object for a case class that has a method with the same name as a field Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant