[Nickle]union switch has unreachable default

Bart Massey nickle@nickle.org
Wed, 28 Aug 2002 23:44:53 -0700


I've seen this before: ML does it.  Now if you just want to
check a couple of cases, it's a pain.

Although it's better in C/Nickle than ML, actually: you can
just write
  union switch(v) {
  case V1:
    /* handle V1 */
    break;
  default:
    /* only care about V1 */
    break;
  }
to shut the compiler up.  Which would be OK, I guess.

Your call.

	Bart

In message <E17kIwk-0002Ni-00@localhost> you wrote:
> 
> Around 23 o'clock on Aug 28, Bart Massey wrote:
> 
> > As cool as it is, I'm afraid it has to go...
> 
> I could add the parallel error if you have a union case which is missing 
> some elements.  That way you'd get a compile-time error instead of your 
> run-time exception.
> 
> -keith
> 
> 
> 
> _______________________________________________
> Nickle mailing list
> Nickle@nickle.org
> http://nickle.org/mailman/listinfo/nickle