Compiler fails on my small sample code

Please checkout my branch with the code that causes failure.

Scala 3.0.0-RC3, Java 11.

sbt "project scala3;clean;compile;test" (there’s also a script named reproduce) causes

[info] exception occurred while typechecking /Users/vpatryshev/projects/private/Categories/scala3/src/test/scala/oops/Test.scala
[info] exception occurred while compiling /Users/vpatryshev/projects/private/Categories/scala3/src/test/scala/oops/Test.scala
scala.MatchError: ThisType(TypeRef(ThisType(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),object oops),class Container)),module class Something$)) (of class dotty.tools.dotc.core.Types$CachedThisType) while compiling /Users/vpatryshev/projects/private/Categories/scala3/src/test/scala/oops/Test.scala
[error] ## Exception when compiling 1 sources to /Users/vpatryshev/projects/private/Categories/scala3/target/scala-3.0.0-RC3/test-classes
(etc)

I’ll be glad to try it with fresher versions.

To reproduce: clone that branch, https://github.com/vpatryshev/Categories/tree/scala3_compiler_problem; cd Categories; ./reproduce.

Thanks! I love Scala 3 anyway.

From memory, think this was fixed in the 3.0.1-RC1.
You can try out that instead.

Unfortunately, not.
[error] ## Exception when compiling 1 sources to /Users/vpatryshev/projects/private/Categories/scala3/target/scala-3.0.1-RC1/test-classes

Did you also try cleaning the cache. sbt clean ?

I tried to compile with 3.0.1-RC1. It compiled but when running the tests, I got the error. You can raise the issue here. GitHub - lampepfl/dotty: The Scala 3 compiler, also known as Dotty.

This looks like Self alias in object nested in class breaks pickler · Issue #11648 · lampepfl/dotty · GitHub

2 Likes

the command is sbt "project scala3;clean;compile;test", so, yes, I did. All the time.

Looks like the same case. As soon as I remove the self alias, it does not crash. But it’s still allowed, in spite of the statement that it was merged in 3.0.0-RC1.