diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 56b0b7457f83..b46f3ebede7b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -126,7 +126,7 @@ jobs: community_build: runs-on: [self-hosted, Linux] container: lampepfl/dotty:2020-04-24 - + if: false steps: - name: Checkout cleanup script uses: actions/checkout@v2 @@ -167,11 +167,6 @@ jobs: test_sbt: runs-on: [self-hosted, Linux] container: lampepfl/dotty:2020-04-24 - if: ( - github.event_name == 'push' && - startsWith(github.event.ref, 'refs/tags/') - ) || - github.event_name == 'schedule' steps: - name: Checkout cleanup script diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 44e9d162d8a6..2ddf92eb2eb6 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -1176,7 +1176,7 @@ object SymDenotations { final def scalacLinkedClass(using Context): Symbol = if (this.is(ModuleClass)) companionNamed(effectiveName.toTypeName) - else if (this.isClass) companionNamed(effectiveName.moduleClassName) + else if (this.isClass) companionNamed(effectiveName.moduleClassName).sourceModule.moduleClass else NoSymbol /** Find companion class symbol with given name, or NoSymbol if none exists. diff --git a/sbt-dotty/sbt-test/scala2-compat/finagle/build.sbt b/sbt-dotty/sbt-test/scala2-compat/finagle/build.sbt new file mode 100644 index 000000000000..a3c28b3d6943 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/finagle/build.sbt @@ -0,0 +1,4 @@ +scalaVersion := sys.props("plugin.scalaVersion") + +libraryDependencies += + ("com.twitter" %% "finagle-core" % "20.9.0").withDottyCompat(scalaVersion.value) diff --git a/sbt-dotty/sbt-test/scala2-compat/finagle/i9916.scala b/sbt-dotty/sbt-test/scala2-compat/finagle/i9916.scala new file mode 100644 index 000000000000..7c692f529428 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/finagle/i9916.scala @@ -0,0 +1,10 @@ +import com.twitter.finagle.Stack +import com.twitter.finagle.liveness.FailureAccrualFactory + +trait T { + def p: FailureAccrualFactory.Param +} + +class A { + val t = Stack.Param[FailureAccrualFactory.Param](FailureAccrualFactory.Param(???)) +} diff --git a/sbt-dotty/sbt-test/scala2-compat/finagle/project/plugins.sbt b/sbt-dotty/sbt-test/scala2-compat/finagle/project/plugins.sbt new file mode 100644 index 000000000000..c17caab2d98c --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/finagle/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version")) diff --git a/sbt-dotty/sbt-test/scala2-compat/finagle/test b/sbt-dotty/sbt-test/scala2-compat/finagle/test new file mode 100644 index 000000000000..5df2af1f3956 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/finagle/test @@ -0,0 +1 @@ +> compile diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt new file mode 100644 index 000000000000..e9c732d4853a --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/build.sbt @@ -0,0 +1,15 @@ +val scala3Version = sys.props("plugin.scalaVersion") +val scala2Version = "2.13.3" + +lazy val `i9916a-lib` = (project in file ("lib")) + .settings(scalaVersion := scala2Version) + +lazy val `i9916a-test` = (project in file ("main")) + .dependsOn(`i9916a-lib`) + .settings( + scalaVersion := scala3Version, + // https://github.com/sbt/sbt/issues/5369 + projectDependencies := { + projectDependencies.value.map(_.withDottyCompat(scalaVersion.value)) + } + ) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/lib/i9916a-lib.scala b/sbt-dotty/sbt-test/scala2-compat/i9916a/lib/i9916a-lib.scala new file mode 100644 index 000000000000..44882333a2f5 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/lib/i9916a-lib.scala @@ -0,0 +1,7 @@ +package i9916a + +object Lib { + trait P + object P + def P(x: Int): P = ??? +} diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/main/i9916a-test.scala b/sbt-dotty/sbt-test/scala2-compat/i9916a/main/i9916a-test.scala new file mode 100644 index 000000000000..1b10c3504ca7 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/main/i9916a-test.scala @@ -0,0 +1,5 @@ +import i9916a.Lib + +trait Test { + def foo: Lib.P +} diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/project/plugins.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916a/project/plugins.sbt new file mode 100644 index 000000000000..c17caab2d98c --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version")) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916a/test b/sbt-dotty/sbt-test/scala2-compat/i9916a/test new file mode 100644 index 000000000000..2a848354ed12 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916a/test @@ -0,0 +1 @@ +> i9916a-test/compile diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt new file mode 100644 index 000000000000..51a2d056ddad --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/build.sbt @@ -0,0 +1,15 @@ +val scala3Version = sys.props("plugin.scalaVersion") +val scala2Version = "2.13.3" + +lazy val `i9916b-lib` = (project in file ("lib")) + .settings(scalaVersion := scala2Version) + +lazy val `i9916b-test` = (project in file ("main")) + .dependsOn(`i9916b-lib`) + .settings( + scalaVersion := scala3Version, + // https://github.com/sbt/sbt/issues/5369 + projectDependencies := { + projectDependencies.value.map(_.withDottyCompat(scalaVersion.value)) + } + ) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/lib/i9916b-lib.scala b/sbt-dotty/sbt-test/scala2-compat/i9916b/lib/i9916b-lib.scala new file mode 100644 index 000000000000..0ce017246f86 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/lib/i9916b-lib.scala @@ -0,0 +1,7 @@ +package i9916b + +trait T { + class A + object A + def A(x: Int): Unit = ??? +} diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/main/i9916b-test.scala b/sbt-dotty/sbt-test/scala2-compat/i9916b/main/i9916b-test.scala new file mode 100644 index 000000000000..fb702d1a8617 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/main/i9916b-test.scala @@ -0,0 +1,5 @@ +import i9916b.T + +trait Test { + def foo: T +} diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/project/plugins.sbt b/sbt-dotty/sbt-test/scala2-compat/i9916b/project/plugins.sbt new file mode 100644 index 000000000000..c17caab2d98c --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version")) diff --git a/sbt-dotty/sbt-test/scala2-compat/i9916b/test b/sbt-dotty/sbt-test/scala2-compat/i9916b/test new file mode 100644 index 000000000000..064736132510 --- /dev/null +++ b/sbt-dotty/sbt-test/scala2-compat/i9916b/test @@ -0,0 +1 @@ +> i9916b-test/compile