Skip to content

Compiling collections: subtyping failures for Factories #779

Closed
@DarkDimius

Description

@DarkDimius

while compiling scala.collection.immutable.Map

$ dotc Map.scala
warning: encountered F-bounded higher-kinded type parameters for type scala$collection$generic$GenMapFactory$$CC; assuming they are invariant
warning: encountered F-bounded higher-kinded type parameters for type scala$collection$generic$MapFactory$$CC; assuming they are invariant
warning: encountered F-bounded higher-kinded type parameters for type scala$collection$generic$ImmutableMapFactory$$CC; assuming they are invariant
Map.scala:79: error: Type argument [HK$0, +HK$1] => scala.collection.immutable.Map[HK$0, HK$1] does not conform to upper bound [HK$0, +HK$1] =>
   <:
    scala.collection.immutable.Map[HK$0, HK$1] &
      scala.collection.immutable.MapLike[HK$0, HK$1,
        LazyRef([HK$0, +HK$1] => scala.collection.immutable.Map[HK$0, HK$1])[
          HK$0
        , HK$1]
      ]
object Map extends ImmutableMapFactory[Map] {
                                       ^
three warnings found
one error found

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions