Skip to content

Commit

Permalink
Update Scala to 3.0.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Feb 17, 2021
1 parent a96254d commit f49baed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import mill._, scalalib._, scalajslib._, scalanativelib._, publish._

val dottyVersions = sys.props.get("dottyVersion").toList

val scalaVersions = "2.11.12" :: "2.12.13" :: "2.13.4" :: "3.0.0-M3" :: dottyVersions
val scalaVersions = "2.11.12" :: "2.12.13" :: "2.13.4" :: "3.0.0-RC1" :: dottyVersions
val scala2Versions = scalaVersions.filter(_.startsWith("2."))

val scalaJSVersions = for {
Expand Down
8 changes: 7 additions & 1 deletion sourcecode/src-3/sourcecode/Macros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,14 @@ object Macros {
owner match {
case defSym if defSym.isDefDef =>
defSym.tree.asInstanceOf[DefDef].paramss
// FIXME Could be a List[TypeDef] too, although I'm not
// sure under which conditions this can happen…
.map(_.asInstanceOf[List[ValDef]])
case classSym if classSym.isClassDef =>
classSym.tree.asInstanceOf[ClassDef].constructor.paramss
// FIXME Could be a List[TypeDef] too, although I'm not
// sure under which conditions this can happen…
.map(_.asInstanceOf[List[ValDef]])
case _ =>
nearestEnclosingMethod(owner.owner)
}
Expand All @@ -213,7 +219,7 @@ object Macros {

def text[T: Type](v: Expr[T])(using Quotes): Expr[sourcecode.Text[T]] = {
import quotes.reflect._
val txt = Term.of(v).pos.sourceCode.get
val txt = v.asTerm.pos.sourceCode.get
'{sourcecode.Text[T]($v, ${Expr(txt)})}
}

Expand Down

0 comments on commit f49baed

Please sign in to comment.