Skip to content

Certain concrete type projections written in Scala 3 can't be used in Scala 2 #13114

@jadenPete

Description

@jadenPete

Reproduction steps

Scala 2 version: 2.13.16
Scala 3 version: 3.6.3

  1. Clone this minimum reproducability case:
    https://github.com/jadenPete/scala-type-projection-bug-reproduction

  2. Run sbt compile

  3. Observe the following compilation error:

[error] .../scala2/Scala2.scala:6:23: type mismatch;
[error]  found   : Scala3#InnerClass
[error]  required: Scala3.this.InnerClass
[error]     ThingDoer.doThing(inner)
[error]                       ^
[error] one error found

Problem

I'd expect this to compile, since ThingDoer.doThing expects a Scala3#InnerClass, which is the type of inner. I'm not even sure what the Scala3.this.InnerClass type is, since that only seems to make sense within the context of Scala3, not ThingDoer. This works if Scala2.scala is compiled with Scala 3, indicating that this is probably an issue with Scala 2's TASTy reader.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions