You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a pattern match where the contents of the quote are statically known we want to propagate the
type inside the pattern the the binding. For example `e` will not only be an `Expr[T]` but also
an `Expr[Some[Int]]`.
```scala
(s: Expr[T]) match {
case e @ '{ Some($x: Int) } =>
// e: Expr[T & Some[Int]]
// x: Expr[Int]
}
```
If the expression in the pattern contains a spliced expression, possibly typed, we also need to propagate the
type of the scrutinee down into the pattern. For example `x` will not only be an `Expr[Boolean]` but also
an `Expr[T]`.
```scala
(s: Expr[T]) match {
case e @ '{ $x: Boolean } =>
// e: Expr[T & Boolean]
// x: Expr[T & Boolean]
}
```
0 commit comments