Skip to content

Doesn't build on 2.11 #13

@retronym

Description

@retronym

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
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions