Skip to content

Commit 01dbc14

Browse files
Scala 3 warnings as errors
1 parent cde9315 commit 01dbc14

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

core/src/main/scala/as/core.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.asynchttpclient
66
import org.asynchttpclient.handler.resumable._
77
import java.io._
88
import java.nio.charset.Charset
9+
import java.io.Closeable
910

1011
object Response {
1112
def apply[T](f: asynchttpclient.Response => T) = f
@@ -36,7 +37,7 @@ object File extends {
3637
val resumableHandler = new ResumableAsyncHandler
3738
with OkHandler[asynchttpclient.Response]
3839
with CloseResourcesOnThrowableHandler[asynchttpclient.Response] {
39-
override lazy val closeable = Seq(fileHandler)
40+
override lazy val closeable: Seq[Closeable] = Seq(fileHandler)
4041
}
4142

4243
resumableHandler

core/src/main/scala/defaults.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private[dispatch] object InternalDefaults {
2828

2929
/** Sets a user agent, no timeout for requests */
3030
private object BasicDefaults extends Defaults {
31-
lazy val timer = new HashedWheelTimer()
31+
lazy val timer: Timer = new HashedWheelTimer()
3232

3333
private val userAgent = "Dispatch/%s" format BuildInfo.version
3434
private val infinite = Duration.ofMillis(-1)

core/src/main/scala/execution.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ case class Http(
1313
) extends HttpExecutor {
1414
import DefaultAsyncHttpClientConfig.Builder
1515

16-
lazy val client = new DefaultAsyncHttpClient(clientBuilder.build)
16+
lazy val client: AsyncHttpClient = new DefaultAsyncHttpClient(clientBuilder.build)
1717

1818
/**
1919
* Returns a new instance replacing the underlying `clientBuilder` with a new instance that is

jsoup/src/main/scala/as/soup.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ object Query {
1313
import org.jsoup.select.Elements
1414
def apply(query: String): Response => Elements =
1515
Document(_).select(query)
16-
}
16+
}
1717

1818
object Clean {
1919
import org.jsoup.safety.Whitelist

project/common.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ object Common {
2626
"-unchecked",
2727
"-language:higherKinds",
2828
"-language:implicitConversions",
29-
// "-Xfatal-warnings",
3029
"-Xlint",
3130
"-Ywarn-dead-code",
3231
"-Ywarn-numeric-widen",
33-
"-Ywarn-value-discard"
32+
"-Ywarn-value-discard",
33+
"-Xsource:3"
3434
),
3535

3636
Compile / scalacOptions ++= {

tagsoup/src/main/scala/as/soup.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ import org.ccil.cowan.tagsoup.jaxp.SAXFactoryImpl
99
object NodeSeq extends (Response => XNodeSeq) {
1010
lazy val parserFactory = new SAXFactoryImpl
1111
lazy val adapter = new NoBindingFactoryAdapter
12-
def apply(r: Response) =
12+
def apply(r: Response): scala.xml.NodeSeq =
1313
adapter.loadXML(new InputSource(r.getResponseBodyAsStream), parserFactory.newSAXParser)
1414
}

0 commit comments

Comments
 (0)