Odin union unhandled_switch_cases error?

annoying bug, i think at least

U :: union #no_nil {
  A, B, C, D
}

f :: proc(u: U) {
  switch v in u {
  case A: use_a(v)
  case B: use_b(v)
  case: oopsy()
  }
}

why does case: not get noticed? like it doesn’t exist?

If I understand everything correctly, you just need to add #partial to the switch. This is a frequently asked question: Frequently Asked Questions | Odin Programming Language

1 Like

thanks, sorry for that :sweat_smile:, wish you a great week

1 Like

No problem, I had to look it up because I really wasn’t sure myself so I learned something as well :smiley:
Also: welcome to the forum!

1 Like