Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
cchantep committed Mar 10, 2022
1 parent 85b3c09 commit e20e8e4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
strategy:
matrix:
jdk: [ 11, 8 ]
scala: [ 2.12.15, 2.13.8, 3.1.2-RC1-bin-20211222-c94b333-NIGHTLY ] # Should be sync with Mergify conditions (.mergify.yml)
scala: [ 2.12.15, 2.13.8, 3.1.2-RC2 ] # Should be sync with Mergify conditions (.mergify.yml)
name: Check / Tests (Scala ${{ matrix.scala }} & JDK ${{ matrix.jdk }})
steps:
- name: Checkout
Expand Down
2 changes: 0 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import com.typesafe.tools.mima.core._
import sbtcrossproject.CrossPlugin.autoImport.crossProject
import sbtcrossproject.CrossType

ThisBuild / scalafmtOnCompile := true

resolvers ++= DefaultOptions.resolvers(snapshot = true)

val isScala3 = Def.setting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ The macros work for classes and traits meeting the following requirements.
- The return types of the `unapply` must match the argument types of the `apply` method.
- The parameter names of the `apply` method must be the same as the property names desired in the JSON.

**Class in Scala 3.x:**
**Class in Scala 3.1.x:** (+3.1.2-RC2)

- It must be provided a [`Conversion`](https://dotty.epfl.ch/api/scala/Conversion.html) to a `_ <: Product`.
- It must be provided a valid [`ProductOf`](https://dotty.epfl.ch/api/scala/deriving/Mirror$.html#ProductOf-0).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ private[json] trait MacroHelpers { self: OptionSupport =>

def unapply(tpr: TypeRepr): Option[TypeRepr] = {
if (self.isOptionalType(tpr)) {
tpr.typeArgs.headOption
// TODO: tpr.typeArgs.headOption

tpr match {
case AppliedType(_, args) => args.headOption
case _ => None
}
} else None
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ package play.api.libs.json
import org.scalatest.matchers.must.Matchers
import org.scalatest.wordspec.AnyWordSpec

import org.scalacheck.Gen

class MacroScala2Spec extends AnyWordSpec with Matchers with org.scalatestplus.scalacheck.ScalaCheckPropertyChecks {
import MacroScala2Spec._

Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ object Dependencies {
// - Mergify conditions (.mergify.yml)
val Scala212 = "2.12.15"
val Scala213 = "2.13.8"
val Scala3 = "3.1.2-RC1-bin-20211222-c94b333-NIGHTLY"
val Scala3 = "3.1.2-RC2"
}

0 comments on commit e20e8e4

Please sign in to comment.