File tree 3 files changed +17
-3
lines changed
compiler/src/dotty/tools/dotc/transform
3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -160,12 +160,12 @@ object Splicer {
160
160
// OK
161
161
162
162
case _ =>
163
+ val extra = if tree.span.isZeroExtent then " : " + tree.show else " "
163
164
ctx.error(
164
- """ Malformed macro parameter
165
+ s """ Malformed macro parameter $extra
165
166
|
166
- |Parameters may be:
167
+ |Parameters may only be:
167
168
| * Quoted parameters or fields
168
- | * References to inline parameters
169
169
| * Literal values of primitive types
170
170
| """ .stripMargin, tree.sourcePos)
171
171
}
Original file line number Diff line number Diff line change
1
+ -- Error: tests/neg-macros/i7839.scala:4:18 ----------------------------------------------------------------------------
2
+ 4 | ${ transformImpl } // error
3
+ | ^
4
+ | Malformed macro parameter: dummyImplicit
5
+ |
6
+ | Parameters may only be:
7
+ | * Quoted parameters or fields
8
+ | * Literal values of primitive types
Original file line number Diff line number Diff line change
1
+ import scala .quoted ._
2
+
3
+ inline def transform (using dummyImplicit : DummyImplicit ): Unit =
4
+ $ { transformImpl } // error
5
+
6
+ def transformImpl (using dummyImplicit : DummyImplicit )(using QuoteContext ): Expr [Unit ] = ???
You can’t perform that action at this time.
0 commit comments