Michaelt293 / union-dotty

Error handling with union types in Dotty
Other
16 stars 0 forks source link

Test for handleSome fails with Scala 3 #3

Open mikkom opened 2 years ago

mikkom commented 2 years ago

Looks like the handleSome method no longer works with Scala 3. I tried with Scala versions 3.0.2 and 3.1.0 and with both the included test for handleSome results in a long error output that includes the following message:

java.lang.AssertionError: assertion failed: orphan parameter reference: TypeParamRef(E2) while compiling .../union-dotty/src/test/scala/io/github/michaelt293/union/TestProgram.scala

Do you have an idea how that could be fixed?

And thanks for creating this repo—it's a great example of the usefulness of union types!

mikkom commented 2 years ago

On second thought, this does look like a compiler bug. Possibly this one: https://github.com/lampepfl/dotty/issues/10242