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

Doesn't work well with custom apply on case class #624

Open
mio-19 opened this issue Sep 4, 2024 · 2 comments
Open

Doesn't work well with custom apply on case class #624

mio-19 opened this issue Sep 4, 2024 · 2 comments

Comments

@mio-19
Copy link

mio-19 commented Sep 4, 2024

Exception occurred while executing macro expansion.
scala.quoted.runtime.impl.ExprCastException: 
  Expected type: chester.syntax.core.Intersection
  Actual type: chester.syntax.core.Term
  Expression: chester.syntax.core.Intersection.apply(params.apply(0).asInstanceOf[scala.collection.immutable.Vector[chester.syntax.core.Term]])

I am having

case class Intersection(xs: Vector[Term]) extends Term derives ReadWriter {
...
}

object Intersection {
  def apply(xs: Vector[Term]): Term = ...
@mio-19 mio-19 changed the title Doesn't work well with custom apply on case class Doesn't work well with custom apply on case class Sep 4, 2024
@mio-19
Copy link
Author

mio-19 commented Sep 4, 2024

It is better to use new SomeCaseClass() instead of SomeCaseClass.apply()

@nox213
Copy link
Contributor

nox213 commented Oct 14, 2024

#607
I think upickle uses apply on purpose .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants