Skip to content

Fix #9916: Round-trip through sourceModule in scalacLinkedClass #9976

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
5 changes: 0 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions sbt-dotty/sbt-test/scala2-compat/finagle/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
scalaVersion := sys.props("plugin.scalaVersion")

libraryDependencies +=
("com.twitter" %% "finagle-core" % "20.9.0").withDottyCompat(scalaVersion.value)
10 changes: 10 additions & 0 deletions sbt-dotty/sbt-test/scala2-compat/finagle/i9916.scala
Original file line number Diff line number Diff line change
@@ -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(???))
}
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/finagle/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> compile