Compiler version
3.9.0
Minimized code
lib.scala:
package repro
trait Outer {
trait InnerSupport { this: Companion.type =>
def foo: Unit = ()
}
val Companion: CompanionTrait
trait CompanionTrait extends InnerSupport { this: Companion.type => }
}
user.test.scala:
package repro
class User(c: Outer)
scala-cli compile --test --scala 3.9.0 . # Cyclic reference involving trait CompanionTrait
scala-cli compile --test --scala 3.8.4 . # Compiles fine
Output
Compiling project (test, Scala 3.9.0, JVM (22))
Error compiling project (test, Scala 3.9.0, JVM (22))
Error: Unexpected error when compiling repro-final_088de9e3c3-test: dotty.tools.dotc.core.CyclicReference: Cyclic reference involving trait CompanionTrait
Run with -explain-cyclic for more details.
Compilation failed
Expectation
Compiling project (Scala 3.9.0, JVM (22))
Compiled project (Scala 3.9.0, JVM (22))
Compiling project (test, Scala 3.9.0, JVM (22))
Compiled project (test, Scala 3.9.0, JVM (22))
Context: I bumped Scala 3 version to 3.9.0 on Kindlings in this PR. The code worked before, as far as I can tell it is correct - if I compile the macro, I can run it against 3.9.0 (e.g. I bumped Chimney to use that newer version of Hearth yesterday, and moved Chimney to 3.9.0 and it works). Kindlings however fails, and apparently it fails in its macro-extensions definition. This is minimization of
the pattern that occurs there which should work since 3.3.8 till 3.8.4 and fail on 3.9.0.
Compiler version
3.9.0
Minimized code
lib.scala:user.test.scala:Output
Expectation
Context: I bumped Scala 3 version to 3.9.0 on Kindlings in this PR. The code worked before, as far as I can tell it is correct - if I compile the macro, I can run it against 3.9.0 (e.g. I bumped Chimney to use that newer version of Hearth yesterday, and moved Chimney to 3.9.0 and it works). Kindlings however fails, and apparently it fails in its macro-extensions definition. This is minimization of
the pattern that occurs there which should work since 3.3.8 till 3.8.4 and fail on 3.9.0.