scala.meta.Lit.type does not take parameters

96 Views Asked by At

When I run the following:

import scala.meta._

class Test {
  val x = q"1"
}

I get scala.meta.Lit.type does not take parameters val x = q"1"

scalameta_2.11:1.8.0

paradise_2.11.8:3.0.0-M7

I'm trying to get some basic macro examples working, specifically the "Hello" example found here:

https://www.beyondthelines.net/computing/generating-protobuf-formats-with-scala-meta-macros/

Where I get the same error on the "val hello ...." line

Any thoughts/suggestions would be greatly appreciated - I'm really excited to have a play with macros!

1

There are 1 best solutions below

7
dveim On

You should wrap your code with inline & meta, just like in your example.

If you just want to analyze what meta does, you could type <code>.parse[Type / Stat]