diff --git a/.travis.yml b/.travis.yml index 226784c496..f554e84773 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,8 @@ git: scala: - 2.11.12 - - 2.13.0-M4 - - 2.12.6 + - 2.13.0-M5 + - 2.12.7 jdk: - oraclejdk8 diff --git a/build.sbt b/build.sbt index 63f45e5f5b..69122d431a 100644 --- a/build.sbt +++ b/build.sbt @@ -62,13 +62,13 @@ lazy val catsSettings = Seq( "bintray/non".at("http://dl.bintray.com/non/maven") ), libraryDependencies ++= Seq( - "org.typelevel" %%% "machinist" % "0.6.5", - compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.7") + "org.typelevel" %%% "machinist" % "0.6.6", + compilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8") ) ++ macroDependencies(scalaVersion.value), ) ++ commonSettings ++ publishSettings ++ scoverageSettings ++ simulacrumSettings lazy val simulacrumSettings = Seq( - libraryDependencies += "com.github.mpilquist" %%% "simulacrum" % "0.13.0" % Provided, + libraryDependencies += "com.github.mpilquist" %%% "simulacrum" % "0.14.0" % Provided, pomPostProcess := { (node: xml.Node) => new RuleTransformer(new RewriteRule { override def transform(node: xml.Node): Seq[xml.Node] = node match { @@ -132,10 +132,10 @@ lazy val includeGeneratedSrc: Setting[_] = { // 2.13.0-M4 workarounds def catalystsVersion(scalaVersion: String): String = - if (priorTo2_13(scalaVersion)) "0.6" else "0.7" + if (priorTo2_13(scalaVersion)) "0.6" else "0.8" def scalatestVersion(scalaVersion: String): String = - if (priorTo2_13(scalaVersion)) "3.0.5" else "3.0.6-SNAP1" + if (priorTo2_13(scalaVersion)) "3.0.5" else "3.0.6-SNAP5" def scalaCheckVersion(scalaVersion: String): String = if (priorTo2_13(scalaVersion)) "1.13.5" else "1.14.0" @@ -151,8 +151,6 @@ lazy val disciplineDependencies = Seq( lazy val testingDependencies = Seq( libraryDependencies += "org.typelevel" %%% "catalysts-platform" % catalystsVersion(scalaVersion.value), libraryDependencies += "org.typelevel" %%% "catalysts-macros" % catalystsVersion(scalaVersion.value) % "test", - // 2.13.0-M3 workaround - // libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion % "test") libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion(scalaVersion.value) % "test" ) @@ -216,7 +214,7 @@ lazy val docSettings = Seq( Seq("-Yno-adapted-args") else Seq("-Ymacro-annotations")), - scalacOptions in Tut ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-dead-code"))), + scalacOptions in Tut ~= (_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports", "-Ywarn-dead-code"))), git.remoteRepo := "git@github.com:typelevel/cats.git", includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.yml" | "*.md" | "*.svg", includeFilter in Jekyll := (includeFilter in makeSite).value @@ -478,11 +476,11 @@ lazy val testsJS = tests.js lazy val testkit = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Pure) .dependsOn(macros, core, laws) + .enablePlugins(BuildInfoPlugin) + .settings(buildInfoKeys := Seq[BuildInfoKey](scalaVersion), buildInfoPackage := "cats.tests") .settings(moduleName := "cats-testkit") .settings(catsSettings) .settings(disciplineDependencies) - // 2.13.0-M3 workaround - //.settings(libraryDependencies += "org.scalatest" %%% "scalatest" % scalaTestVersion) .settings(libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion(scalaVersion.value)) .jsSettings(commonJsSettings) .jvmSettings(commonJvmSettings) @@ -506,7 +504,7 @@ lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform) .settings(includeGeneratedSrc) .jsSettings(commonJsSettings) .jvmSettings(commonJvmSettings) - .settings(scalacOptions ~= { _.filterNot("-Ywarn-unused-import" == _) }) //export-hook triggers unused import + .settings(scalacOptions ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) }) //export-hook triggers unused import lazy val alleycatsCoreJVM = alleycatsCore.jvm lazy val alleycatsCoreJS = alleycatsCore.js @@ -789,8 +787,16 @@ lazy val sharedReleaseProcess = Seq( ) lazy val warnUnusedImport = Seq( - scalacOptions ++= Seq("-Ywarn-unused-import"), - scalacOptions in (Compile, console) ~= { _.filterNot("-Ywarn-unused-import" == _) }, + scalacOptions ++= { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 11)) => + Seq("-Ywarn-unused-import") + case Some((2, n)) if n >= 12 => + Seq("-Ywarn-unused:imports") + + } + }, + scalacOptions in (Compile, console) ~= { _.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports")) }, scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value ) diff --git a/kernel/src/main/scala-2.13+/cats/kernel/compat/TraversableOnce.scala b/kernel/src/main/scala-2.13+/cats/kernel/compat/TraversableOnce.scala index 9e33c1e857..bcfc4635be 100644 --- a/kernel/src/main/scala-2.13+/cats/kernel/compat/TraversableOnce.scala +++ b/kernel/src/main/scala-2.13+/cats/kernel/compat/TraversableOnce.scala @@ -1,8 +1,7 @@ package cats.kernel package compat - -private[kernel] object TraversableOnce { +private[kernel] object TraversableOnce { def reduceOption[A, A1 >: A](as: TraversableOnce[A], op: (A1, A1) => A1): Option[A1] = as.iterator.reduceOption(op) } diff --git a/kernel/src/main/scala-2.13+/cats/kernel/compat/WrappedMutableMapBase.scala b/kernel/src/main/scala-2.13+/cats/kernel/compat/WrappedMutableMapBase.scala index aee19bb29c..f72cb62387 100644 --- a/kernel/src/main/scala-2.13+/cats/kernel/compat/WrappedMutableMapBase.scala +++ b/kernel/src/main/scala-2.13+/cats/kernel/compat/WrappedMutableMapBase.scala @@ -3,8 +3,7 @@ package compat import scala.collection.mutable - -private[kernel] abstract class WrappedMutableMapBase[K, V](m: mutable.Map[K, V]) extends Map[K, V] { +abstract private[kernel] class WrappedMutableMapBase[K, V](m: mutable.Map[K, V]) extends Map[K, V] { def updated[V2 >: V](key: K, value: V2): Map[K, V2] = m.toMap + ((key, value)) def remove(key: K): Map[K, V] = m.toMap - key } diff --git a/project/build.properties b/project/build.properties index 0cd8b07982..7c58a83abf 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.3 +sbt.version=1.2.6 diff --git a/project/plugins.sbt b/project/plugins.sbt index 9eaf84d224..6ae0eb03ce 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -15,6 +15,7 @@ addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2") addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.9") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.25") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.8") addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "1.5.1") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") diff --git a/tests/src/test/scala/cats/tests/RepresentableSuite.scala b/tests/src/test/scala/cats/tests/RepresentableSuite.scala index 77ff37eea5..c29196f13b 100644 --- a/tests/src/test/scala/cats/tests/RepresentableSuite.scala +++ b/tests/src/test/scala/cats/tests/RepresentableSuite.scala @@ -60,8 +60,12 @@ class RepresentableSuite extends CatsSuite { } { + //the monadInstance below made a conflict to resolve this one. + implicit val isoFun1: Isomorphisms[String => ?] = Isomorphisms.invariant[String => ?] + implicit val monadInstance = Representable.monad[String => ?] checkAll("String => ?", MonadTests[String => ?].monad[String, String, String]) + } // Syntax tests. If it compiles is "passes" diff --git a/tests/src/test/scala/cats/tests/TrySuite.scala b/tests/src/test/scala/cats/tests/TrySuite.scala index f59ad050a7..89411f020f 100644 --- a/tests/src/test/scala/cats/tests/TrySuite.scala +++ b/tests/src/test/scala/cats/tests/TrySuite.scala @@ -17,7 +17,11 @@ class TrySuite extends CatsSuite { checkAll("Try[Int]", CoflatMapTests[Try].coflatMap[Int, Int, Int]) checkAll("CoflatMap[Try]", SerializableTests.serializable(CoflatMap[Try])) - checkAll("Try with Throwable", MonadErrorTests[Try, Throwable].monadError[Int, Int, Int]) + //temporarily disable this test due to scala.util.Failure regression https://github.com/scala/bug/issues/11242 + if (BuildInfo.scalaVersion != "2.13.0-M5") { + checkAll("Try with Throwable", MonadErrorTests[Try, Throwable].monadError[Int, Int, Int]) + } + checkAll("MonadError[Try, Throwable]", SerializableTests.serializable(MonadError[Try, Throwable])) checkAll("Try[Int] with Option", TraverseTests[Try].traverse[Int, Int, Int, Int, Option, Option])