Skip to content

Commit

Permalink
Scala 2.12.12 and 2.13.3 (#247)
Browse files Browse the repository at this point in the history
* Fix Lazy auto-application warnings on 2.13
 * Enable `-Xfatal-warnings`
 * Cache Coursier directory on CI
  • Loading branch information
joroKr21 authored Aug 30, 2020
1 parent 0681652 commit 4a85faa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
language: scala

scala:
- 2.12.11
- 2.13.2
- 2.12.12
- 2.13.3

jdk:
- openjdk8

cache:
directories:
- "$HOME/.cache/coursier"
- "$HOME/.ivy2/cache"
- "$HOME/.sbt"

Expand Down
7 changes: 4 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

lazy val buildSettings = Seq(
organization := "org.typelevel",
scalaVersion := "2.13.2",
crossScalaVersions := Seq("2.12.11", scalaVersion.value)
scalaVersion := "2.13.3",
crossScalaVersions := Seq("2.12.12", scalaVersion.value)
)

val catsVersion = "2.1.1"
Expand All @@ -18,7 +18,8 @@ lazy val commonSettings = Seq(
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-deprecation"
"-deprecation",
"-Xfatal-warnings"
),
scalacOptions ++= (
CrossVersion.partialVersion(scalaVersion.value) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ object VersionSpecific {

@implicitNotFound("could not find Lazy implicit value of type ${A}")
abstract class Lazy[+A] extends Serializable {
def value(): A
def value: A
}

object Lazy {
implicit def instance[A](implicit ev: => A): Lazy[A] = () => ev
implicit def instance[A](implicit ev: => A): Lazy[A] = new Lazy[A] {
def value: A = ev
}
}

sealed trait OrElse[+A, +B] extends Serializable {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/derived/iterable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ trait MkIterable[F[_]] {
}
}

def next: A =
def next(): A =
if (!hasNext) Iterator.empty.next()
else (first: @unchecked) match {
case IterState.Return(a) =>
first = IterState.Done
a
case IterState.Iterate(it) =>
it.next
it.next()
}
}
}
Expand Down

0 comments on commit 4a85faa

Please sign in to comment.