Details

      Description

      Probably it's not a bug, however looks very suspicious

      class Result[+A]
       
      case class Success[A](x: A) extends Result[A]
       
      class Apply[A]
       
      object Apply {
        def apply[A](f: Int => Result[A]): Apply[A] = new Apply[A]
      }
       
      object TestUnit {
        //Error is here:
        def goo = Apply { i =>
          i match {
            case 1 => Success(Some(1))
            case _ => Success(None)
          }
        }
        
        //If type is defined explicitly (which I wanted from compiler to infer), then all is ok
        def foo = Apply[t forSome {type t >: Some[Int] with None.type <: Option[Int]}] { i =>
          i match {
            case 1 => Success(Some(1))
            case _ => Success(None)
          }
        }
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            soc Simon Ochsenreither added a comment -

            Error with Scala version 2.10.0-M2-0152-g5dca64cefe-2012-03-13:

            <console>:12: error: no type parameters for method apply: (f: Int => Result[A])Apply[A] in object Apply exist so that it can be applied to arguments (Int => Success[_ >: Some[Int] with None.type <: Option[Int]])
             --- because ---
            argument expression's type is not compatible with formal parameter type;
             found   : Int => Success[_ >: Some[Int] with None.type <: Option[Int]]
             required: Int => Result[?A]
                   def goo : Apply[Option[Int]] = Apply { i =>
                                                  ^
            <console>:12: error: type mismatch;
             found   : Int => Success[_ >: Some[Int] with None.type <: Option[Int]]
             required: Int => Result[A]
                   def goo : Apply[Option[Int]] = Apply { i =>
                                                            ^
            <console>:12: error: type mismatch;
             found   : Apply[A]
             required: Apply[Option[Int]]
                   def goo : Apply[Option[Int]] = Apply { i =>
                                                        ^
            

            Show
            soc Simon Ochsenreither added a comment - Error with Scala version 2.10.0-M2-0152-g5dca64cefe-2012-03-13: <console>:12: error: no type parameters for method apply: (f: Int => Result[A])Apply[A] in object Apply exist so that it can be applied to arguments (Int => Success[_ >: Some[Int] with None.type <: Option[Int]]) --- because --- argument expression's type is not compatible with formal parameter type; found : Int => Success[_ >: Some[Int] with None.type <: Option[Int]] required: Int => Result[?A] def goo : Apply[Option[Int]] = Apply { i => ^ <console>:12: error: type mismatch; found : Int => Success[_ >: Some[Int] with None.type <: Option[Int]] required: Int => Result[A] def goo : Apply[Option[Int]] = Apply { i => ^ <console>:12: error: type mismatch; found : Apply[A] required: Apply[Option[Int]] def goo : Apply[Option[Int]] = Apply { i => ^
            Hide
            phaller Philipp Haller added a comment -

            Test in pending/pos.

            Show
            phaller Philipp Haller added a comment - Test in pending/pos.
            Hide
            moors Adriaan Moors added a comment -

            Unassigning and rescheduling to M6 as previous deadline was missed.

            Show
            moors Adriaan Moors added a comment - Unassigning and rescheduling to M6 as previous deadline was missed.

              People

              • Assignee:
                Unassigned
                Reporter:
                alefas Alexander
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: