Skip to content

Some path-dependent types involving classes compiled with Scala 3 don't compile #13150

@jadenPete

Description

@jadenPete

Reproduction steps

Scala 2 version: 2.13.18
Scala 3 version: 3.7.3

  1. Clone this minimum reproducibility case:
    https://github.com/jadenPete/scala-path-dependent-type-bug-reproduction

  2. Run sbt compile

  3. Observe the following compilation error:

[error] <REDACTED>/feature-flag-evaluator/src/main/scala/FeatureFlagEvaluator.scala:3:50: type mismatch;
[error]  found   : flagWithData.flag.schema.Data
[error]  required: flagWithData.flag.schema.Data
[error]     flagWithData.flag.schema.parser(flagWithData.data)
[error]                                                  ^
[error] one error found

Problem

I'd expect this to compile. If all four projects in the repository are compiled with the same major Scala version (Scala 2 or Scala 3), this does compile. It seems to be an issue specifically with Scala 2/3 compatibility. Note that this may be an issue with the Scala 3, and not Scala 2. If it is, let me know and I'll close this issue/open one in https://github.com/scala/scala3. It also may be possible to whittle this down to an even more minimal reproducibility case then the one I've presented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions