Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.11.7, Scala 2.12.0-M3
    • Fix Version/s: Backlog
    • Component/s: Type Checker
    • Labels:
      None

      Description

      This works:

      class Bar[A] { 
        def foo(x: collection.GenTraversableOnce[A]) = 3 
      }
      implicit class BarOps[A](b: Bar[A]) { 
        def foo[F[_]](f: F[Int]) = 4
      }
      (new Bar).foo(List(3)) // returns 3
      (new Bar).foo(scalaz.IList(3)) // returns 4
      

      This doesn't work:

      implicit class BarOps[A](b: Bar[A]) { 
        def foo[F[_]](f: F[A]) = 4 // changed Int to A
      }
      (new Bar).foo(scalaz.IList(3)) // error: type mismatch;
      //   found : scalaz.IList[Int]
      //   required: scala.collection.GenTraversableOnce[?]
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                arya Arya Irani
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: