Remove test warning suppressions, fix all resulting warnings#14
Open
halotukozak wants to merge 6 commits intoseries/3.x-avsfrom
Open
Remove test warning suppressions, fix all resulting warnings#14halotukozak wants to merge 6 commits intoseries/3.x-avsfrom
halotukozak wants to merge 6 commits intoseries/3.x-avsfrom
Conversation
…ables, and clean up unused imports in tests and core implementations
There was a problem hiding this comment.
Pull request overview
This PR tightens compiler hygiene by removing test-only warning suppressions and re-enabling Scala 3 “fatal warnings” behavior, then updating production and test code to compile cleanly under stricter warning settings.
Changes:
- Removed
Test / scalacOptions --=suppressions for-Wunused:patvarsand-Xlint:constant, and removed the Scala 3-Werrorexclusion inbuild.sbt. - Updated code to explicitly discard values (
: Unit) where results are intentionally ignored, and silenced irrefutable-pattern warnings (: @unchecked) where intended. - Cleaned up tests to avoid unused loop variables and replaced constant-overflow expressions with equivalent non-overflowing literals.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| monix-tail/shared/src/main/scala/monix/tail/internal/IterantTakeLast.scala | Discard buffer.offer results explicitly to satisfy non-Unit statement warnings. |
| monix-tail/shared/src/main/scala/monix/tail/internal/IterantCompleteL.scala | Discard cursor.next() results explicitly during cursor draining. |
| monix-reactive/shared/src/test/scala/monix/reactive/subjects/ReplaySubjectSuite.scala | Replace unused loop variable with wildcard in subscription loops. |
| monix-reactive/shared/src/test/scala/monix/reactive/subjects/PublishSubjectSuite.scala | Replace unused loop variable with wildcard in subscription loops. |
| monix-reactive/shared/src/test/scala/monix/reactive/subjects/ProfunctorSubjectSuite.scala | Replace unused loop variable with wildcard in subscription loops. |
| monix-reactive/shared/src/test/scala/monix/reactive/subjects/BehaviorSubjectSuite.scala | Replace unused loop variable with wildcard in subscription loops. |
| monix-reactive/shared/src/test/scala/monix/reactive/internal/rstreams/MonixSubscriberAsReactiveSuite.scala | Replace unused loop variable with wildcard in stress loop. |
| monix-reactive/shared/src/test/scala/monix/reactive/internal/operators/BufferIntrospectiveSuite.scala | Replace unused loop variable with wildcard in repeated onNext loop. |
| monix-execution/shared/src/test/scala/monix/execution/schedulers/ExecutionModelSuite.scala | Replace unused loop variable with wildcard in frame-advance loop. |
| monix-execution/shared/src/test/scala/monix/execution/cancelables/OrderedCancelableSuite.scala | Replace constant-overflow expressions with equivalent Long.MinValue values. |
| monix-execution/shared/src/test/scala/monix/execution/CancelableSuite.scala | Add : @unchecked to suppress irrefutable-pattern warnings in tests. |
| monix-execution/shared/src/main/scala/monix/execution/CancelablePromise.scala | Add : @unchecked to suppress irrefutable-pattern warning when destructuring a non-empty list. |
| monix-execution/shared/src/main/scala/monix/execution/CancelableFuture.scala | Discard pf(r) result explicitly in andThen. |
| monix-execution/shared/src/main/scala/monix/execution/Ack.scala | Discard Promise.trySuccess boolean result explicitly. |
| monix-execution/jvm/src/test/scala/monix/execution/atomic/ConcurrentAtomicSuite.scala | Replace unused loop variables with wildcards in concurrent tests. |
| monix-execution/jvm/src/test/scala/monix/execution/atomic/ConcurrentAtomicNumberSuite.scala | Replace unused loop variables with wildcards in concurrent tests. |
| monix-execution/jvm/src/main/scala/monix/execution/schedulers/AdaptedThreadPoolExecutor.scala | Discard future.get() result explicitly in afterExecute. |
| monix-eval/shared/src/test/scala/monix/eval/TaskMemoizeOnSuccessSuite.scala | Replace unused loop variables with wildcards in stack-safety loops. |
| monix-eval/shared/src/test/scala/monix/eval/TaskExecuteWithOptionsSuite.scala | Add : @unchecked to suppress irrefutable-pattern warning when destructuring f.value. |
| monix-eval/shared/src/main/scala/monix/eval/internal/TaskFromFuture.scala | Discard conn.pop() result explicitly. |
| monix-eval/shared/src/main/scala/monix/eval/internal/TaskCreate.scala | Discard ctx.connection.pop() result explicitly. |
| monix-eval/shared/src/main/scala/monix/eval/internal/TaskConversions.scala | Discard conn.pop() result explicitly. |
| build.sbt | Removes test warning suppressions and the Scala 3 -Werror exclusion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nference across observables and operators
…plicit type annotations in test suites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test / scalacOptions --=that suppressed-Wunused:patvarsand-Xlint:constantin tests-Werrorblanket disable: Unittype ascriptions to discard-value expressions (conn.pop(),p.trySuccess(),cursor.next(),future.get(),pf(r),buffer.offer()): @uncheckedto irrefutable pattern matches (val Some(...) = ...,val x :: xs = ...,val CompositeException(...) = ...)for (i <-) with wildcards (for (_ <-) across 12 test filesLong.MaxValue + 1constant overflow withLong.MinValueequivalentNote: 4
thread.getIddeprecation warnings remain — these will be addressed separately.Test plan
sbt +testpasses for all modules exceptexecutionJVM/Compile(pre-existinggetIddeprecation)OrderedCancelableSuitetests🤖 Generated with Claude Code