File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2082,7 +2082,7 @@ class Typer extends Namer
20822082 }
20832083
20842084 private def checkSpliceOutsideQuote (tree : untpd.Tree )(implicit ctx : Context ): Unit = {
2085- if (level == 0 && ! ctx.owner.isInlineMethod )
2085+ if (level == 0 && ! ctx.owner.ownersIterator.exists(_.is( Inline )) )
20862086 ctx.error(" Splice ${...} outside quotes '{...} or inline method" , tree.sourcePos)
20872087 else if (level < 0 )
20882088 ctx.error(
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ inline def test (f : (Int , Int ) => Int ) = $ { // error: Malformed macro
4+ testImpl((a : Expr [Int ], b : Expr [Int ]) => ' { f($ {a}, $ {b}) })
5+ }
6+
7+ def testImpl (f : (Expr [Int ], Expr [Int ]) => Expr [Int ]): Expr [Int ] = ???
You can’t perform that action at this time.
0 commit comments