-
Notifications
You must be signed in to change notification settings - Fork 7
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
Type Mismatch Error for the same type #26
Comments
Hey @LightSystem! Thanks for reporting the issue and sorry for the inconvenience that it causes! I can reproduce it locally and will be taking a closer look at it in the following days. The issue seems to stem from the placement of the case class in the companion object, just as you said. In the meantime a workaround (you probably figured it out already but I'm putting it out there in case someone also stumbles upon this) is to move out the definition of case class A(anotherCaseClass: AnotherCaseClass)
case class AnotherCaseClass(name: String)
object A:
case class B(anotherCaseClass: AnotherCaseClass) |
Some further findings: It turns out that if you refer to case class A(anotherCaseClass: A.AnotherCaseClass)
object A {
case class AnotherCaseClass(name: String)
case class B(anotherCaseClass: A.AnotherCaseClass)
} it's all fine and dandy, but once you get rid of the So that'd make it the go-to workaround for this issue for now - I'm investigating further 😸 |
Managed to pinpoint the cause and resolve the issue, more details in #27. |
Hi @arainko,
First of all thank you for this awesome library! It is a godsend that is helping us migrate to Scala 3 in a more painless manner 😌
I've just started using it for some of our case class transformations and have encountered a curious issue. Seems to have to do with companion objects or objects in general.
Let's imagine I have these case classes:
AnotherCaseClass
can be simple or complex, it doesn't matter. If I then do:I get the following compilation error:
I'm using scala
3.2.1
and ducktape version0.1.1
.Thanks again. If I get some time I'll try to research this problem deeper by looking into ducktape's codebase though metaprogramming is something I'm not very familiar with yet.
The text was updated successfully, but these errors were encountered: