Skip to content

Cannot unpickle secondary constructors in quotes #4313

Open
@nicolasstucki

Description

@nicolasstucki
import scala.quoted._
import scala.quoted.staging.{Compiler => StagingCompiler, _}

object Test {
  given StagingCompiler = StagingCompiler.make(getClass.getClassLoader)

  def main(args: Array[String]): Unit =
    withQuotes {
      val q = '{
        class Foo(a: Int) {
          def this() = this(6)
        }
        ()
      }
      println(q.show)
    }
}

fails with

wrong number of arguments at <no phase> for (): Foo: ((): Foo)(Foo.this.<init>), expected: 0, found: 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions