Scala Programming Language
  1. Scala Programming Language
  2. SI-5020

Kind conformance error: Same bounds are considered stricter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.1
    • Fix Version/s: Scala 2.10.0
    • Component/s: Misc Compiler
    • Labels:
      None

      Description

      Sample code:

      sealed trait GenericList[U, M[_ <: U]] {
        type Transformed[N[MMA <: U]] <: GenericList[U, N]
      }
      
      trait GenericCons[U, M[_ <: U], T <: GenericList[U, M]] extends
      GenericList[U, M] {
        type Transformed[N[MMB <: U]] = GenericCons[U, N, GenericList[U,
      M]#Transformed[N]]
      }
      

      Expected behaviour:

      Compiles

      Actual behaviour:

      Error message "kinds of the type arguments (N) do not conform to the expected kinds of
      the type parameters (type N).
      N's type parameters do not match type N's expected parameters: type
      MMB's bounds >: Nothing <: U are stricter than type MMA's declared
      bounds >: Nothing <: U"

      (might be related to SI-3374)

        Activity

        Hide
        Lars Hupel added a comment -

        The same problem occurs for lower bounds:

        sealed trait GenericList[L, M[_ >: L]] {
          type Transformed[N[MMA >: L]] <: GenericList[L, N]
        }
        
        trait GenericCons[L, M[_ >: L], T <: GenericList[L, M]] extends GenericList[L, M] {
          type Transformed[N[MMB >: L]] = GenericCons[L, N, T#Transformed[N]]
        }
        
        Show
        Lars Hupel added a comment - The same problem occurs for lower bounds: sealed trait GenericList[L, M[_ >: L]] { type Transformed[N[MMA >: L]] <: GenericList[L, N] } trait GenericCons[L, M[_ >: L], T <: GenericList[L, M]] extends GenericList[L, M] { type Transformed[N[MMB >: L]] = GenericCons[L, N, T#Transformed[N]] }
        Hide
        Paul Phillips added a comment -

        I think this is fixed in a6ebd0f3ee .

        Show
        Paul Phillips added a comment - I think this is fixed in a6ebd0f3ee .

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Lars Hupel
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development