thyme icon indicating copy to clipboard operation
thyme copied to clipboard

Doesn't build on 2.11

Open retronym opened this issue 9 years ago • 0 comments

Scala 2.10 contained a bug that failed to outlaw use of default arguments in more than one overloaded alternative when the alternatives involve type parameters.

Thyme exploits the compiler bug in the following overloads, and as such doesn't build under 2.11

  /** Order handling.  See `order` for details of parameters.  Returns a tuple containing a result from `f`; prints a benchmarking report. */
  def porder[A,B](resource: Int => Thyme.Resource[B])(f: Thyme.Resource[B] => A)(n0: Int, title: String = "", pr: String => Unit = Thyme.printer): A = {
    val bo = Thyme.Scaled.empty
    val ans = order(resource)(f)(bo,n0)
    bo.title = title
    pr(bo.toString)
    ans
  }

  /** Order handling.  Packs functions into `Resource` automatically. (Args for `f` are `start`, `n`, `data`.) Returns a tuple containing a result from `f`; prints a benchmarking report. */
  def porder[A,B](resource: Int => B)(f: (Int,Int,B) => A)(n0: Int, title: String = "", pr: String => Unit = Thyme.printer): A = {
    val bo = Thyme.Scaled.empty
    val ans = order(Thyme.Resource(resource))(Thyme.Resource.inline(f))(bo, n0)
    bo.title = title
    pr(bo.toString)
    ans
  }

retronym avatar Feb 09 '16 11:02 retronym