Skip to content

Compilation of code with synthetic companion objects is non-deterministic #12066

@retronym

Description

@retronym

This new test case fails in DeterminismTest

  @Test def testSyntheticModuleLocationInDecls(): Unit = {
    def code = List[SourceFile](
      source("a.scala",
        """
          | object A {
          |   class C(val a: Any) extends AnyVal
          |   implicit class I1(a: String)
          |   implicit class IV(val a: String) extends AnyVal
          |   case class CC()
          | }
          |
      """.stripMargin),
      source("b.scala",
        """
          | object B {
          |   // Order here reversed from definition order in A
          |   A.CC()
          |   A.IV("")
          |   A.I1("")
          |   new A.C("")
          | }
          |
      """.stripMargin)
    )
    test(List(code))
  }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions