-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
wrong number of arguments at getClass for (): PackratParsers #8847
Comments
Standalone reproducer below. Note that this is a Scala 2 interop issue, and only occurs when the trait is compiled by Scala 2 and extended in a file compiled by Scala 3. lib/lib.scala package i8847
trait P {
// The `private` modifier is needed, and `X` must be a case class or case object
private case class X(x: Int)
// private case object X
} main/test.scala import i8847.P
class T extends P build.sbt lazy val lib = (project in file ("lib"))
.settings(scalaVersion := "2.13.3")
lazy val main = (project in file ("main"))
.dependsOn(lib)
.settings(
scalaVersion := "0.24.0-RC1",
projectDependencies := {
projectDependencies.value.map(_.withDottyCompat(scalaVersion.value))
}
) Output from Dotty 0.24.0-RC1 [info] Compiling 1 Scala source to /src/dotty-issues/i8847/lib/target/scala-2.13/classes ...
[info] Done compiling.
[info] Compiling 1 Scala source to /src/dotty-issues/i8847/main/target/scala-0.24/classes ...
[error] -- Error: /src/dotty-issues/i8847/main/test.scala:3:17 -----------------------------------
[error] 3 |class T extends P
[error] | ^
[error] |wrong number of arguments at getClass for (): P.this.X$: (P.this.X$#<init> : (): P.this.X$), expected: 0, found: 1
[error] one error found
[error] (main / Compile / compileIncremental) Compilation failed This is fixed by #8652. |
While creating a standalone reproducer from the original and bisecting this issue, I ran into another: lib.scala package i8847
trait Foo {
def foo(): Unit = ???
}
trait Bar extends Foo {
override def foo(): Unit = super.foo()
}
trait Baz extends Foo {
override def foo(): Unit = super.foo()
} test.scala import i8847.{ Bar, Baz }
class C extends Bar with Baz
This issue appears to have been both introduced and corrected during the commit sequence of #8652. |
The code fragment compiles on scala 2.13.1 but not on dotty 0.24.0-RC1,
Minimized code
Output
Expectation
The text was updated successfully, but these errors were encountered: