-
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
Update Scala to 3.0.0-RC1 #103
Conversation
@@ -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 | |||
// under which conditions this can happen… | |||
.map(_.asInstanceOf[List[ValDef]]) |
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.
paramss
is a List[ParamClause[T]
, with ParamClause[T]
being List[ValDef[T]] | List[TypeDef[T]]
. So we can't just match paramss
with
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 | ||
// under which conditions this can happen… | ||
.map(_.asInstanceOf[List[ValDef]]) |
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.
Same as above.
a8581fa
to
f49baed
Compare
@@ -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… |
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.
No description provided.