-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Scala to 3.0.0-RC1 #103
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
paramss match {
case l: List[ValDef] =>
case l: List[TypeDef] =>
} because of type erasure. |
||
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]]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
case _ => | ||
nearestEnclosingMethod(owner.owner) | ||
} | ||
|
@@ -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)})} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can currently happen with extension methods with a type parameter clause on the extension block and the method itself (cf scala/scala3#10940), and in the (post-3.0) future we plan to allow users to add type parameter clauses after term parameter clauses in all methods.