Skip to content

Fix #8847: Add regression test #10064

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

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions sbt-dotty/sbt-test/scala2-compat/i8847/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
val scala3Version = sys.props("plugin.scalaVersion")
val scala2Version = "2.13.3"

lazy val `i8847-lib` = (project in file ("lib"))
.settings(scalaVersion := scala2Version)

lazy val `i8847-test` = (project in file ("main"))
.dependsOn(`i8847-lib`)
.settings(
scalaVersion := scala3Version,
// https://github.com/sbt/sbt/issues/5369
projectDependencies := {
projectDependencies.value.map(_.withDottyCompat(scalaVersion.value))
}
)
19 changes: 19 additions & 0 deletions sbt-dotty/sbt-test/scala2-compat/i8847/lib/i8847-lib.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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 Y
}

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()
}
5 changes: 5 additions & 0 deletions sbt-dotty/sbt-test/scala2-compat/i8847/main/i8847-test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import i8847.{P, Bar, Baz}

class T extends P

class C extends Bar with Baz
1 change: 1 addition & 0 deletions sbt-dotty/sbt-test/scala2-compat/i8847/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version"))
1 change: 1 addition & 0 deletions sbt-dotty/sbt-test/scala2-compat/i8847/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> i8847-test/compile