Skip to content
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

Merged
merged 2 commits into from
Feb 22, 2021

Conversation

alexarchambault
Copy link
Collaborator

No description provided.

@@ -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]])
Copy link
Collaborator Author

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]])
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@@ -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…
Copy link
Contributor

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.

@anatoliykmetyuk anatoliykmetyuk merged commit 891bcb9 into com-lihaoyi:master Feb 22, 2021
@alexarchambault alexarchambault deleted the scala-3.0.0-RC1 branch February 24, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants