Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in sciss/kollflitz v0.2.4 #16338

Closed
dwijnand opened this issue Nov 14, 2022 · 0 comments · Fixed by #16344
Closed

Regression in sciss/kollflitz v0.2.4 #16338

dwijnand opened this issue Nov 14, 2022 · 0 comments · Fixed by #16344
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@dwijnand
Copy link
Member

[error] -- [E008] Not Found Error: /home/jenkins/agent/workspace/buildCommunityProject/repo/shared/src/test/scala/de/sciss/kollflitz/TagTest.scala:19:23 
[error] 19 |  val median  = tagged.percentile(50)
[error]    |                ^^^^^^^^^^^^^^^^^
[error]    |                value percentile is not a member of IndexedSeq[Int]
[error] one error found
[error] (rootJVM / Test / compileIncremental) Compilation failed
package de.sciss.kollflitz

import Ops._

object TagTest extends App {
  val vec     = Vec(3, 5, 1, 10, -1, 22)
  val tagged  = tag[Sorted](vec) : Vec[Int] @@ Sorted
  val median  = tagged.percentile(50)
  val q25     = vec.sortedT.percentile(25)
  println(s"Median of $vec is $median")
}
  type Tagged[U]  = { type Tag  = U }
  type @@ [+T, U] = T with Tagged[U]
  private val anyTagger = new Tagger[Any]
  final class Tagger[U] private[kollflitz] {
    def apply[T](t : T): T @@ U = t.asInstanceOf[T @@ U]
  }
  def tag[U]: Tagger[U] = anyTagger.asInstanceOf[Tagger[U]]

  sealed trait Sorted


  /** Enrichment methods for random access collections. */
  implicit final class KollFlitzSortedIndexedSeq[A, CC[_], Repr](val self: SeqOps[A, CC, Repr] @@ Sorted)
    extends AnyVal {

    /** Nearest percentile (rounded index, no interpolation). */
    def percentile(n: Int): A = self((self.size * n - 50) / 100)

    /** Median found by rounding the index (no interpolation). */
    def median: A = percentile(50)
  }
@dwijnand dwijnand changed the title sciss/kollflitz v0.2.4 Regression in sciss/kollflitz v0.2.4 Nov 14, 2022
@dwijnand dwijnand added itype:bug area:typer regression This worked in a previous version but doesn't anymore labels Nov 14, 2022
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:typer itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants