-
Notifications
You must be signed in to change notification settings - Fork 73
[build] update to Scala 3.7 + update other deps #1175
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,7 +170,7 @@ object StreamCompression: | |
Present(cont), | ||
Chunk.empty[Byte] | ||
))) | ||
case Absent -> _ => | ||
case _ => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the compiler started complaining about exhaustiveness check |
||
IO(deflater.finish()).andThen(Loop.continue(DeflateState.PullDeflater( | ||
deflater, | ||
Absent, | ||
|
@@ -280,7 +280,7 @@ object StreamCompression: | |
crc32.update(toUnboxByteArray(bytes)) | ||
deflater.setInput(toUnboxByteArray(bytes)) | ||
}.andThen(Loop.continue(GZipState.PullDeflater(deflater, crc32, Present(cont), Chunk.empty[Byte]))) | ||
case Absent -> _ => | ||
case _ => | ||
IO(deflater.finish()).andThen(Loop.continue(GZipState.PullDeflater(deflater, crc32, Absent, Chunk.empty[Byte]))) | ||
} | ||
case GZipState.PullDeflater(deflater, crc32, maybeEmitFn, chunk) => | ||
|
@@ -361,7 +361,7 @@ object StreamCompression: | |
.andThen( | ||
Loop.continue(InflateState.PullInflater(inflater, Present(emitFn), bytes)) | ||
) | ||
case Absent -> _ => | ||
case _ => | ||
IO(Loop.continue(InflateState.PullInflater(inflater, Absent, Chunk.empty))) | ||
case InflateState.PullInflater(inflater, maybeEmitFn, bytes) => | ||
if inflater.finished then | ||
|
@@ -517,7 +517,7 @@ object StreamCompression: | |
Emit.runFirst(emit).map: | ||
case Present(bytes) -> emitFn => | ||
Loop.continue(GunzipState.ParseHeader(accBytes.concat(bytes), headerCrc32, emitFn())) | ||
case Absent -> _ => | ||
case _ => | ||
if accBytes.isEmpty then | ||
// No data, we stop | ||
Loop.done | ||
|
@@ -563,7 +563,7 @@ object StreamCompression: | |
commentsToSkip, | ||
emitFn() | ||
)) | ||
case Absent -> _ => | ||
case _ => | ||
Abort | ||
.fail(new StreamCompressionException("Invalid GZip header")) | ||
.andThen(Loop.done) | ||
|
@@ -581,7 +581,7 @@ object StreamCompression: | |
commentsToSkip, | ||
emitFn() | ||
)) | ||
case Absent -> _ => | ||
case _ => | ||
Abort | ||
.fail(new StreamCompressionException("Invalid GZip header")) | ||
.andThen(Loop.done) | ||
|
@@ -609,7 +609,7 @@ object StreamCompression: | |
commentsToSkip, | ||
emitFn() | ||
)) | ||
case Absent -> _ => | ||
case _ => | ||
Abort | ||
.fail(new StreamCompressionException("Invalid GZip header")) | ||
.andThen(Loop.done) | ||
|
@@ -628,7 +628,7 @@ object StreamCompression: | |
Emit.runFirst(emit).map: | ||
case Present(bytes) -> emitFn => | ||
Loop.continue(GunzipState.CheckCrc16(accBytes.concat(bytes), headerCrc32, emitFn())) | ||
case Absent -> _ => | ||
case _ => | ||
Abort | ||
.fail(new StreamCompressionException("Invalid GZip header")) | ||
.andThen(Loop.done) | ||
|
@@ -657,7 +657,7 @@ object StreamCompression: | |
.andThen( | ||
Loop.continue(GunzipState.PullInflater(inflater, contentCrc32, Present(emitFn), bytes)) | ||
) | ||
case Absent -> _ => | ||
case _ => | ||
Loop.continue(GunzipState.PullInflater(inflater, contentCrc32, Absent, Chunk.empty)) | ||
else | ||
IO(inflater.setInput(toUnboxByteArray(leftOver))) | ||
|
@@ -703,7 +703,7 @@ object StreamCompression: | |
contentCrc32, | ||
Present(nextEmitFn) | ||
)) | ||
case Absent -> _ => | ||
case _ => | ||
Loop.continue(GunzipState.CheckTrailer(accBytes, inflater, contentCrc32, Absent)) | ||
case Absent => | ||
Abort.fail[StreamCompressionException](StreamCompressionException("Checksum error")) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ import scala.util.control.NoStackTrace | |
* @see | ||
* [[Fiber.Unsafe]] for low-level operations requiring [[AllowUnsafe]] | ||
*/ | ||
opaque type Fiber[+E, +A] = IOPromise[? <: E, ? <: A] | ||
opaque type Fiber[+E, +A] = IOPromiseBase[E, A] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The compile crashes with |
||
|
||
object Fiber extends FiberPlatformSpecific: | ||
|
||
|
@@ -107,13 +107,15 @@ object Fiber extends FiberPlatformSpecific: | |
|
||
extension [E, A](self: Fiber[E, A]) | ||
|
||
private[kyo] def asPromise: IOPromise[E, A] = self.asInstanceOf[IOPromise[E, A]] | ||
|
||
/** Gets the result of the Fiber. | ||
* | ||
* @return | ||
* The result of the Fiber | ||
*/ | ||
def get(using reduce: Reducible[Abort[E]], frame: Frame): A < (reduce.SReduced & Async) = | ||
Async.get(self) | ||
Async.get(self.asPromise) | ||
|
||
/** Uses the result of the Fiber to compute a new value. | ||
* | ||
|
@@ -123,14 +125,14 @@ object Fiber extends FiberPlatformSpecific: | |
* The result of applying the function to the Fiber's result | ||
*/ | ||
def use[B, S](f: A => B < S)(using reduce: Reducible[Abort[E]], frame: Frame): B < (reduce.SReduced & Async & S) = | ||
Async.use(self)(f) | ||
Async.use(self.asPromise)(f) | ||
|
||
/** Gets the result of the Fiber as a Result. | ||
* | ||
* @return | ||
* The Result of the Fiber | ||
*/ | ||
def getResult(using Frame): Result[E, A] < Async = Async.getResult(self) | ||
def getResult(using Frame): Result[E, A] < Async = Async.getResult(self.asPromise) | ||
|
||
/** Uses the Result of the Fiber to compute a new value. | ||
* | ||
|
@@ -139,7 +141,7 @@ object Fiber extends FiberPlatformSpecific: | |
* @return | ||
* The result of applying the function to the Fiber's Result | ||
*/ | ||
def useResult[B, S](f: Result[E, A] => B < S)(using Frame): B < (Async & S) = Async.useResult(self)(f) | ||
def useResult[B, S](f: Result[E, A] => B < S)(using Frame): B < (Async & S) = Async.useResult(self.asPromise)(f) | ||
|
||
/** Checks if the Fiber is done. | ||
* | ||
|
@@ -177,7 +179,7 @@ object Fiber extends FiberPlatformSpecific: | |
* The Result of the Fiber, or a Timeout error | ||
*/ | ||
def block(timeout: Duration)(using Frame): Result[E | Timeout, A] < IO = | ||
Clock.deadline(timeout).map(d => self.block(d.unsafe)) | ||
Clock.deadline(timeout).map(d => self.asPromise.block(d.unsafe)) | ||
|
||
/** Converts the Fiber to a Future. | ||
* | ||
|
@@ -267,7 +269,7 @@ object Fiber extends FiberPlatformSpecific: | |
* @return | ||
* The number of waiters on this Fiber | ||
*/ | ||
def waiters(using Frame): Int < IO = IO(self.waiters()) | ||
def waiters(using Frame): Int < IO = IO(self.asPromise.waiters()) | ||
|
||
/** Polls the Fiber for a result without blocking. | ||
* | ||
|
@@ -510,7 +512,7 @@ object Fiber extends FiberPlatformSpecific: | |
} | ||
} | ||
|
||
opaque type Unsafe[+E, +A] = IOPromise[? <: E, ? <: A] | ||
opaque type Unsafe[+E, +A] = IOPromiseBase[E, A] | ||
|
||
/** WARNING: Low-level API meant for integrations, libraries, and performance-sensitive code. See AllowUnsafe for more details. */ | ||
object Unsafe: | ||
|
@@ -526,7 +528,7 @@ object Fiber extends FiberPlatformSpecific: | |
case Failure(ex) => | ||
completeDiscard(Result.fail(ex)) | ||
|
||
f.onComplete(p)(ExecutionContext.parasitic) | ||
f.onComplete(p)(using ExecutionContext.parasitic) | ||
p | ||
end fromFuture | ||
|
||
|
@@ -550,21 +552,21 @@ object Fiber extends FiberPlatformSpecific: | |
end toFuture | ||
|
||
def map[B](f: A => B)(using AllowUnsafe): Unsafe[E, B] = | ||
val p = new IOPromise[E, B](interrupts = self) with (Result[E, A] => Unit): | ||
val p = new IOPromise[E, B](interrupts = self.asPromise) with (Result[E, A] => Unit): | ||
def apply(v: Result[E, A]) = completeDiscard(v.map(f)) | ||
lower.onComplete(p) | ||
p | ||
end map | ||
|
||
def flatMap[E2, B](f: A => Unsafe[E2, B])(using AllowUnsafe): Unsafe[E | E2, B] = | ||
val p = new IOPromise[E | E2, B](interrupts = self) with (Result[E, A] => Unit): | ||
val p = new IOPromise[E | E2, B](interrupts = self.asPromise) with (Result[E, A] => Unit): | ||
def apply(r: Result[E, A]) = r.foldError(v => becomeDiscard(f(v).asInstanceOf[IOPromise[E | E2, B]]), completeDiscard) | ||
lower.onComplete(p) | ||
p | ||
end flatMap | ||
|
||
def mapResult[E2, B](f: Result[E, A] => Result[E2, B])(using AllowUnsafe): Unsafe[E2, B] = | ||
val p = new IOPromise[E2, B](interrupts = self) with (Result[E, A] => Unit): | ||
val p = new IOPromise[E2, B](interrupts = self.asPromise) with (Result[E, A] => Unit): | ||
def apply(r: Result[E, A]) = completeDiscard(Result(f(r)).flatten) | ||
lower.onComplete(p) | ||
p | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,7 +257,6 @@ object Queue: | |
object Unsafe: | ||
extension [A](self: Unsafe[A]) | ||
def add(value: A)(using AllowUnsafe, Frame): Unit = discard(self.offer(value)) | ||
def safe: Unbounded[A] = self | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the compiler started warning for extension methods that can never be selected. In this case, |
||
|
||
def init[A](access: Access = Access.MultiProducerMultiConsumer, chunkSize: Int = 8)( | ||
using | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,7 +238,7 @@ object Maybe: | |
* @return | ||
* the flattened Maybe | ||
*/ | ||
inline def flatten[B](using inline ev: A <:< Maybe[B]): Maybe[B] = | ||
def flatten[B](using ev: A <:< Maybe[B]): Maybe[B] = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. compiler was crashing with this method inlined |
||
if isEmpty then Absent else ev(get) | ||
|
||
/** Filters the Maybe based on a predicate. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ type ForSome[F[_]] = ForSome.Type[F] | |
object ForSome: | ||
class Unwrap[F[_], A](val unwrap: F[A]) extends AnyVal | ||
|
||
opaque type Type[F[_]] <: Unwrap[F, ?] = Unwrap[F, ?] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @road21 the compiler was crashing and removing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
type Type[F[_]] = Unwrap[F, ?] | ||
|
||
/** Converts value of type `F[A]` to existential form | ||
*/ | ||
|
@@ -26,7 +26,7 @@ type ForSome2[F[_, _]] = ForSome2.Type[F] | |
object ForSome2: | ||
class Unwrap[F[_, _], A1, A2](val unwrap: F[A1, A2]) extends AnyVal | ||
|
||
opaque type Type[F[_, _]] <: Unwrap[F, ?, ?] = Unwrap[F, ?, ?] | ||
type Type[F[_, _]] = Unwrap[F, ?, ?] | ||
|
||
/** Converts value of type `F[A1, A2]` to existential form | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,7 +297,8 @@ class RecordTest extends Test: | |
inline def stage[Name <: String, Value](field: Field[Name, Value]): Column[Value] = | ||
Column[Value](field.name)(using summonInline[AsColumn[Value]]) | ||
|
||
"build record if all inlined" in { | ||
"build record if all inlined" in pendingUntilFixed { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @road21 this is still crashing. I've tried a few things without success. I'll open an issue to follow up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
assertCompiles(""" | ||
type Person = "name" ~ String & "age" ~ Int | ||
|
||
val columns = Record.stage[Person](ColumnInline) | ||
|
@@ -307,6 +308,7 @@ class RecordTest extends Test: | |
assert(columns.name == Column[String]("name")) | ||
assert(columns.age == Column[Int]("age")) | ||
assert(columns == result) | ||
""") | ||
} | ||
|
||
"compile error when inlining failed" in { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the compiler now warns when passing an implicit param without
using