-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix errors in explicit type annotations in inline match cases
Previusly, Unapply trees would have type bindings generated inside their body and this was the only case handled in InlineReducer. However, this happened for inferred type parameters, and Unapply with an explicit binding inside a type annotation was not handled, leading to a "cannot reduce match" error. This case is now handled and a related comment was added as well.
- Loading branch information
Showing
2 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
sealed trait A | ||
case class B[T](x: T) extends A | ||
|
||
object Test { | ||
inline def fun(x: A): Int = inline x match { | ||
case B(x1): B[t] => 0 | ||
} | ||
|
||
@main def main() = | ||
val x = B(0) | ||
fun(x) | ||
} |