Skip to content

Commit f49baed

Browse files
Update Scala to 3.0.0-RC1
1 parent a96254d commit f49baed

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import mill._, scalalib._, scalajslib._, scalanativelib._, publish._
22

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

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

88
val scalaJSVersions = for {

sourcecode/src-3/sourcecode/Macros.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,14 @@ object Macros {
189189
owner match {
190190
case defSym if defSym.isDefDef =>
191191
defSym.tree.asInstanceOf[DefDef].paramss
192+
// FIXME Could be a List[TypeDef] too, although I'm not
193+
// sure under which conditions this can happen…
194+
.map(_.asInstanceOf[List[ValDef]])
192195
case classSym if classSym.isClassDef =>
193196
classSym.tree.asInstanceOf[ClassDef].constructor.paramss
197+
// FIXME Could be a List[TypeDef] too, although I'm not
198+
// sure under which conditions this can happen…
199+
.map(_.asInstanceOf[List[ValDef]])
194200
case _ =>
195201
nearestEnclosingMethod(owner.owner)
196202
}
@@ -213,7 +219,7 @@ object Macros {
213219

214220
def text[T: Type](v: Expr[T])(using Quotes): Expr[sourcecode.Text[T]] = {
215221
import quotes.reflect._
216-
val txt = Term.of(v).pos.sourceCode.get
222+
val txt = v.asTerm.pos.sourceCode.get
217223
'{sourcecode.Text[T]($v, ${Expr(txt)})}
218224
}
219225

0 commit comments

Comments
 (0)