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

existentials too eager to squash bounds of covariant parameters

    Details

      Description

      object Test {
        trait T1[-A <: AnyRef]
        trait T2[-A >: AnyRef]
        trait T3[ A <: AnyRef]
        trait T4[ A >: AnyRef]
        trait T5[+A <: AnyRef]
        trait T6[+A >: AnyRef]
        
        def f1(x: T1[_]) = x
        def f2(x: T2[_]) = x
        def f3(x: T3[_]) = x
        def f4(x: T4[_]) = x
        def f5(x: T5[_]) = x
        def f6(x: T6[_]) = x
        
        // Only f5 fails to compile:
        //   ./a.scala:13: error: type arguments [Any] do not conform to trait T5's type parameter bounds [+A <: AnyRef]
        //     def f5(x: T5[_]) = x
        //         ^
        //   one error found
      }
      

        Activity

        Hide
        Adriaan Moors added a comment -

        Unassigning and rescheduling to M6 as previous deadline was missed.

        Show
        Adriaan Moors added a comment - Unassigning and rescheduling to M6 as previous deadline was missed.
        Hide
        Jason Zaugg added a comment - - edited
        Show
        Jason Zaugg added a comment - - edited Was fixed and tested in https://github.com/scala/scala/commit/e28c3edda4dd405ed382227d2a688b799bf33c72

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development