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

add explicit type #1005

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private abstract class ScalaCheckRunner extends Runner {
case _ => new OptionalThrowable()
}
def fullyQualifiedName() = self.taskDef().fullyQualifiedName()
def selector() = new TestSelector(name)
def selector(): Selector = new TestSelector(name)
def fingerprint() = self.taskDef().fingerprint()
def duration() = -1L
Comment on lines 157 to 160
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity – how come def selector() requires explicit type, but its neighbors (fullyQualifiedName, fingerprint, etc) do not?

}
Expand Down Expand Up @@ -251,7 +251,7 @@ final class ScalaCheckFramework extends Framework {

val applyCmdParams = prms.andThen(sbtSetup(loader))

def receiveMessage(msg: String) = None
def receiveMessage(msg: String): Option[String] = None

override def done() = {
send(s"d$testCount,$successCount,$failureCount,$errorCount")
Expand Down
4 changes: 2 additions & 2 deletions core/shared/src/main/scala/org/scalacheck/Test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ object Test {
val testCallback: TestCallback = new TestCallback {}
val maxDiscardRatio: Float = 5
val customClassLoader: Option[ClassLoader] = None
val propFilter = None
val propFilter: Option[String] = None
val initialSeed: Option[rng.Seed] = None
}

Expand Down Expand Up @@ -369,7 +369,7 @@ object Test {
val help = "Maximum number of RNG spins to perform between checks"
}

val opts = Set[Opt[_]](
val opts: collection.Set[Opt[_]] = Set[Opt[_]](
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering – can the type be collection.immutabe.Set rather than collection.Set? Or does it break compatibility?

OptMinSuccess,
OptMaxDiscardRatio,
OptMinSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object Buildable extends BuildableVersionSpecific {
import java.util.ArrayList
implicit def buildableArrayList[T]: Buildable[T, ArrayList[T]] =
new Buildable[T, ArrayList[T]] {
def builder = new ArrayListBuilder[T]
def builder: mutable.Builder[T, ArrayList[T]] = new ArrayListBuilder[T]
}

def buildableSeq[T]: Buildable[T, Seq[T]] =
Expand Down