Skip to content

Commit

Permalink
Fix Publishing on Master (#3437)
Browse files Browse the repository at this point in the history
* fix publishing

* fix bug
  • Loading branch information
adamgfraser committed Apr 25, 2020
1 parent 5370e53 commit 5685194
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 39 deletions.
4 changes: 2 additions & 2 deletions core/shared/src/main/scala-2.13+/ChunkBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ private[zio] object ChunkBuilder {
that match {
case that: Boolean =>
self.arrayBuilder.equals(that.arrayBuilder) &&
self.maxBitIndex == that.maxBitIndex &&
self.lastByte == that.lastByte
self.maxBitIndex == that.maxBitIndex &&
self.lastByte == that.lastByte
case _ => false
}
override def toString: String =
Expand Down
37 changes: 6 additions & 31 deletions core/shared/src/main/scala/zio/Chunk.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ sealed trait Chunk[+A] extends ChunkLike[A] { self =>
* Returns a filtered, mapped subset of the elements of this chunk based on a .
*/
def collectM[R, E, B](pf: PartialFunction[A, ZIO[R, E, B]]): ZIO[R, E, Chunk[B]] =
self.materialize.collectM(pf)
if (isEmpty) ZIO.succeedNow(Chunk.empty) else self.materialize.collectM(pf)

/**
* Transforms all elements of the chunk for as long as the specified partial function is defined.
*/
def collectWhile[B](pf: PartialFunction[A, B]): Chunk[B] =
self.materialize.collectWhile(pf)
if (isEmpty) Chunk.empty else self.materialize.collectWhile(pf)

def collectWhileM[R, E, B](pf: PartialFunction[A, ZIO[R, E, B]]): ZIO[R, E, Chunk[B]] =
self.materialize.collectWhileM(pf)
if (isEmpty) ZIO.succeedNow(Chunk.empty) else self.materialize.collectWhileM(pf)

/**
* Determines whether this chunk and the specified chunk have the same length
Expand Down Expand Up @@ -705,13 +705,14 @@ sealed trait Chunk[+A] extends ChunkLike[A] { self =>
}

//noinspection AccessorLikeMethodIsUnit
protected[zio] def toArray[A1 >: A](n: Int, dest: Array[A1]): Unit
protected[zio] def toArray[A1 >: A](n: Int, dest: Array[A1]): Unit =
if (isEmpty) () else materialize.toArray(n, dest)

/**
* Returns a filtered, mapped subset of the elements of this chunk.
*/
protected def collectChunk[B](pf: PartialFunction[A, B]): Chunk[B] =
self.materialize.collectChunk(pf)
if (isEmpty) Chunk.empty else self.materialize.collectChunk(pf)

/**
* Returns a chunk with the elements mapped by the specified function.
Expand Down Expand Up @@ -1335,15 +1336,6 @@ object Chunk {
override def apply(n: Int): Nothing =
throw new ArrayIndexOutOfBoundsException(s"Empty chunk access to $n")

override def collectM[R, E, B](pf: PartialFunction[Nothing, ZIO[R, E, B]]): ZIO[R, E, Chunk[B]] =
UIO.succeedNow(Empty)

override def collectWhile[B](pf: PartialFunction[Nothing, B]): Chunk[B] =
Empty

override def collectWhileM[R, E, B](pf: PartialFunction[Nothing, ZIO[R, E, B]]): ZIO[R, E, Chunk[B]] =
UIO.succeedNow(Empty)

override def foreach[B](f: Nothing => B): Unit = {
val _ = f
}
Expand All @@ -1357,23 +1349,6 @@ object Chunk {

override def toArray[A1](implicit tag: ClassTag[A1]): Array[A1] =
Array.empty

override def zipAllWith[B, C](that: Chunk[B])(left: Nothing => C, right: B => C)(
both: (Nothing, B) => C
): Chunk[C] =
that.map(right)

protected[zio] def toArray[A1 >: Nothing](n: Int, dest: Array[A1]): Unit =
()

override protected def collectChunk[B](pf: PartialFunction[Nothing, B]): Chunk[B] =
Empty

/**
* Returns a chunk with the elements mapped by the specified function.
*/
override protected def mapChunk[B](f: Nothing => B): Chunk[B] =
Empty
}

private[zio] object Tags {
Expand Down
10 changes: 4 additions & 6 deletions project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,11 @@ object BuildHelper {
def crossPlatformSources(scalaVer: String, platform: String, conf: String, baseDir: File, isDotty: Boolean) =
CrossVersion.partialVersion(scalaVer) match {
case Some((2, x)) if x <= 11 =>
platformSpecificSources(platform, conf, baseDir)("2.11", "2.x", "2.11-2.12")
case Some((2, x)) if x == 12 =>
platformSpecificSources(platform, conf, baseDir)("2.12+", "2.12", "2.x", "2.11-2.12")
case Some((2, x)) if x >= 13 =>
platformSpecificSources(platform, conf, baseDir)("2.12+", "2.12", "2.x", "2.13+")
platformSpecificSources(platform, conf, baseDir)("2.11", "2.x")
case Some((2, x)) if x >= 12 =>
platformSpecificSources(platform, conf, baseDir)("2.12+", "2.12", "2.x")
case _ if isDotty =>
platformSpecificSources(platform, conf, baseDir)("2.12+", "dotty", "2.13+")
platformSpecificSources(platform, conf, baseDir)("2.12+", "dotty")
case _ =>
Nil
}
Expand Down

0 comments on commit 5685194

Please sign in to comment.