File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
compiler/src/dotty/tools/dotc/typer
tests/run-macros/quote-matcher-inference Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ trait QuotesAndSplices {
7373 case _ =>
7474 }
7575 if (ctx.mode.is(Mode .QuotedPattern ))
76- if (isFullyDefined(pt, ForceDegree .all )) {
76+ if (isFullyDefined(pt, ForceDegree .flipBottom )) {
7777 def spliceOwner (ctx : Context ): Symbol =
7878 if (ctx.mode.is(Mode .QuotedPattern )) spliceOwner(ctx.outer) else ctx.owner
7979 val pat = typedPattern(tree.expr, defn.QuotedExprClass .typeRef.appliedTo(pt))(
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+
4+ object Macros {
5+
6+ inline def g (inline x : Unit ): Unit = $ {impl(' x )}
7+
8+ private def impl (x : Expr [Any ])(using QuoteContext ): Expr [Any ] = {
9+ x match
10+ case ' { println(f($y)) } => y
11+ }
12+
13+ }
14+
15+ def f [T ](x : T ): T = x
Original file line number Diff line number Diff line change 1+ import Macros ._
2+
3+
4+ object Test {
5+
6+ def main (args : Array [String ]): Unit = {
7+ g(println(f((5 ))))
8+ }
9+
10+ }
You can’t perform that action at this time.
0 commit comments