File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -2259,7 +2259,7 @@ class Typer extends Namer
22592259 }
22602260
22612261 private def checkSpliceOutsideQuote (tree : untpd.Tree )(implicit ctx : Context ): Unit = {
2262- if (level == 0 && ! ctx.owner.isInlineMethod )
2262+ if (level == 0 && ! ctx.owner.ownersIterator.exists(_.is( Inline )) )
22632263 ctx.error(" Splice ${...} outside quotes '{...} or inline method" , tree.sourcePos)
22642264 else if (level < 0 )
22652265 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 ] = ???
Original file line number Diff line number Diff line change 1+ import scala .quoted ._
2+
3+ def testImpl (f : Expr [(Int , Int ) => Int ]): Expr [Int ] = f(' {1 }, ' {2 })
4+
5+ inline def test (f : (Int , Int ) => Int ) = $ {
6+ testImpl(' f )
7+ }
You can’t perform that action at this time.
0 commit comments