Skip to content

Upper Bound not unified #4043

Closed
Closed
@scabug

Description

@scabug

In the following code, H1 and H0 are both Int, but the types are not unified.

object TypeParam {
  trait GC[K[_ <: H0], H0]

  trait PA[H1] {
    type Apply[A <: H1] = Any
  }

  // error:
  // kinds of the type arguments ([A <: H1]Any,Int) do not conform to the expected kinds of the type parameters (type K,type H0) in trait GC.
  // [A <: H1]Any's type parameters do not match type K's expected parameters:
  // type A's bounds >: Nothing <: H1 are stricter than type _'s declared bounds >: Nothing <: H0
  type a = GC[PA[Int]#Apply, Int]
}

Substituting H1 to Int manually allows compilation:

  trait PA[H1] {
    type Apply[A <: Int] = Any
  }

What versions of the following are you using?
Scala: 2.8.1, 2.9.0-SNAPSHOT

See also r23383

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions