Skip to content

Generated given instances' names are the same for different types #15316

Closed
@nikololiahim

Description

@nikololiahim

Compiler version

3.1.2

Minimized code

//> using scala "3.1.2"

trait Thing[A]
trait Box[A]

given Thing[Box[Int]] = new Thing[Box[Int]] {}
given Thing[Box[String]] = new Thing[Box[String]] {}

Output

Double definition:
final lazy given val given_Thing_Box: Thing[Box[Int]] in package object bug$package at line 6 and
final lazy given val given_Thing_Box: Thing[Box[String]] in package object bug$package at line 7
bloop

Expectation

The code should compile and the instances of Thing for both Box[String] and Box[Int] should be available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions