File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -604,6 +604,10 @@ class ReifyQuotes extends MacroTransformWithImplicits with InfoTransformer {
604604 """ .stripMargin, tree.rhs.pos)
605605 EmptyTree
606606 }
607+ case tree : ValDef if tree.symbol.is(Param | Inline ) && tree.symbol.owner.is(Macro ) &&
608+ defn.isFunctionClass(tree.tpe.widen.typeSymbol) =>
609+ ctx.error(" Macro parameters of function type cannot be `inline`" , tree.pos)
610+ EmptyTree
607611 case _ =>
608612 markDef(tree)
609613 checkLevel(mapOverTree(enteredSyms))
Original file line number Diff line number Diff line change 1+
2+ object Foo {
3+ inline def h (inline f : Int => String ): String = ~ '(f(42)) // error
4+ }
Original file line number Diff line number Diff line change 1+
2+ object Foo {
3+ inline def g (inline p : Int => Boolean ): Boolean = ~ { // error
4+ if (p(5 )) '(true)
5+ else '(false)
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments