Why can't Scala optimize this match for the switch?

I have this pattern matching that matches only bytes, but when I add @switchit says

failed to release switch in @switch annotated match

What am I missing here?

Just FYI that I already tried and didn't work:

  • Moving this constant to the Java interface and using fields public static final byte(I also tried to make them intinstead byte)
  • Mark fields as final valon a Scala objectMessage
  • Mark fields as @inlinea companion object

I am definitely lost here.

+5
source share
1

, scala-user, vals Byte:

object Message {
  final val Authentication = 'R'
  final val BackendKeyData = 'K'
  final val Bind = 'B'
  final val BindComplete = '2'
}

@switch lookupswitch ( a tableswitch, ).

+2

All Articles