@@ -11,28 +11,49 @@ scala> def impl1(c: Context) = { import c.universe._; c.Expr[Unit](q"()") }
11
11
impl1: (c: scala.reflect.macros.blackbox.Context)c.Expr[Unit]
12
12
13
13
scala> def foo1: Unit = macro impl1
14
- defined term macro foo1: Unit
14
+ <console>:14: error: macro implementation reference has wrong shape. required:
15
+ macro [<static object>].<method name>[[<type args>]] or
16
+ macro [<macro bundle>].<method name>[[<type args>]]
17
+ def foo1: Unit = macro impl1
18
+ ^
15
19
16
20
scala> foo1
21
+ <console>:14: error: not found: value foo1
22
+ foo1
23
+ ^
17
24
18
25
scala>
19
26
20
27
scala> def impl2(c: Context)() = { import c.universe._; c.Expr[Unit](q"()") }
21
28
impl2: (c: scala.reflect.macros.blackbox.Context)()c.Expr[Unit]
22
29
23
30
scala> def foo2(): Unit = macro impl2
24
- defined term macro foo2: ()Unit
31
+ <console>:14: error: macro implementation reference has wrong shape. required:
32
+ macro [<static object>].<method name>[[<type args>]] or
33
+ macro [<macro bundle>].<method name>[[<type args>]]
34
+ def foo2(): Unit = macro impl2
35
+ ^
25
36
26
37
scala> foo2()
38
+ <console>:14: error: not found: value foo2
39
+ foo2()
40
+ ^
27
41
28
42
scala>
29
43
30
44
scala> def impl3(c: Context)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._; c.Expr[Unit](q"()") }
31
45
impl3: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int])(y: c.Expr[Int])c.Expr[Unit]
32
46
33
47
scala> def foo3(x: Int)(y: Int): Unit = macro impl3
34
- defined term macro foo3: (x: Int)(y: Int)Unit
48
+ <console>:14: error: macro implementation reference has wrong shape. required:
49
+ macro [<static object>].<method name>[[<type args>]] or
50
+ macro [<macro bundle>].<method name>[[<type args>]]
51
+ def foo3(x: Int)(y: Int): Unit = macro impl3
52
+ ^
35
53
36
54
scala> foo3(2)(3)
55
+ <console>:14: error: not found: value foo3
56
+ foo3(2)(3)
57
+ ^
37
58
38
59
scala> :quit
0 commit comments