ThoughtWorksInc/enableIf.scala

Bug with @enableIf(false) in Scala 2.13

ryanberckmans opened this issue · 1 comments

In Scala 2.13 this code

@enableIf(false) val _ = {
  println("enableIf(false) val _")
}
@enableIf(false) val __ = {
  println("enableIf(false) val __")
}
@enableIf(false) val foo = {
  println("enableIf(false) val foo")
}

outputs enableIf(false) val _ because the annotation seems not to work for val _ as of Scala 2.13.

Tested with sbt 1.1 on java 8 hotspot and graalvm.

Atry commented

In Scala 2.13, val _ is a pattern matching instead of a variable. I don't know if macro annotation is able to support it.