Skip to content

post-2.13.1 regression: getClass not found in secondary constructor body #660

@SethTisue

Description

@SethTisue

on Scala version 2.13.2-bin-161c2a7, in the 2.13 community build, at e.g. https://scala-ci.typesafe.com/job/scala-2.13.x-integrate-community-build/2860/consoleFull , akka-stream is failing with:

[akka-stream] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.16/project-builds/akka-stream-8a2efbf6a483843e2425edb83d04591231140e93/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamSpec.scala:19:45: not found: value getClass
[akka-stream] [error]     this(ActorSystem(AkkaSpec.getCallerName(getClass), ConfigFactory.load(config.withFallback(AkkaSpec.testConf))))
[akka-stream] [error]                                             ^
[akka-stream] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.16/project-builds/akka-stream-8a2efbf6a483843e2425edb83d04591231140e93/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamSpec.scala:25:56: not found: value getClass
[akka-stream] [error]   def this() = this(ActorSystem(AkkaSpec.getCallerName(getClass), AkkaSpec.testConf))
[akka-stream] [error]                                                        ^
[akka-stream] [error] two errors found

ordinarily I could easily git bisect my way to the culprit scala/scala commit, but in this case I can't because the regression seems to have occurred somewhere in a range of commits where akka-stream failed to compile for a different reason. that reason was fixed by @som-snytt in scala/scala#8577, uncovering this other regression

I made some halfhearted stabs at a standalone reproduction, but failed. for example:

Welcome to Scala 2.13.2-bin-161c2a7
scala> class C(x: Class[_]) { def this() = this(getClass) }
class C

actually I tried a little harder than that, and I could certainly try harder still, but before I dig any deeper, I want to ask:

Som, what might be going on here, does any insight jump out at you? could scala/scala#8547 and/or scala/scala#8541 somehow be related? getClass is of course a "universal member", so the presence of "universal member" in those PRs caught my attention

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions