Skip to content

Commit

Permalink
Merge pull request #3 from tpolecat/scala-3.0.0-M3
Browse files Browse the repository at this point in the history
3.0.0-M3
  • Loading branch information
tpolecat authored Jan 4, 2021
2 parents bc0e81e + fe5860e commit dcca3db
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is a Scala micro-library that provides:

The intent is that you can use this instead of `TypeTag` or other heavy machinery.

TypeName is compiled for Scala **2.12**, **2.13**, **3.0.0-M1**, and **3.0.0-M2**.
TypeName is compiled for Scala **2.12**, **2.13**, **3.0.0** (see release notes for exact versions).


```scala
Expand Down
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

// Our Scala versions.
lazy val `scala-3.0` = "3.0.0-M2"
lazy val `scala-3.0-prev` = "3.0.0-M1"
lazy val `scala-3.0` = "3.0.0-M3"
lazy val `scala-3.0-prev` = "3.0.0-M2"
lazy val `scala-2.12` = "2.12.12"
lazy val `scala-2.13` = "2.13.3"
lazy val `scala-2.13` = "2.13.4"

// Publishing
name := "typename"
Expand Down Expand Up @@ -35,7 +35,7 @@ Compile / doc / scalacOptions ++= Seq(
)

// MUnit
libraryDependencies += "org.scalameta" %% "munit" % "0.7.19" % Test
libraryDependencies += "org.scalameta" %% "munit" % "0.7.20" % Test
testFrameworks += new TestFramework("munit.Framework")

// Scala 2 needs scala-reflect
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.2
sbt.version=1.4.6
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.4")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.8.0")
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.9.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.1")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.14")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.12")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.16")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.14")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.6")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.1")
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import scala.quoted._

trait TypeNamePlatform {

inline given [A] as TypeName[A] =
inline given [A]: TypeName[A] =
${TypeNamePlatform.impl[A]}

}

object TypeNamePlatform {

// https://users.scala-lang.org/t/obtaining-the-name-of-a-type-scala-3/6902/7
def impl[A](using t: Type[A], ctx: QuoteContext): Expr[TypeName[A]] =
'{TypeName[A](${Expr(t.show)})}
def impl[A](using t: Type[A], ctx: Quotes): Expr[TypeName[A]] =
'{TypeName[A](${Expr(Type.show[A])})}

}

0 comments on commit dcca3db

Please sign in to comment.