www.digitalmars.com         C & C++   DMDScript  

D - [dmd-Crash and Bug] No type checking in structs?

reply Manfred Nowak <svv1999 hotmail.com> writes:
void main(){
  struct data{
    bit b1=-1;
    bit b2=2;
  }
}

dmd 0.79, win98SE.

This code crashes dmd in the code generation phase.
The type `bit' can be replaced by any type with same result.
If the assigned value is nonnegative, then no crash results.
But no bug is generated for `b2=2': should be out of range or cannot 
convert ìnt' to `bit'.

So long.
Jan 28 2004
parent Manfred Nowak <svv1999 hotmail.com> writes:
Manfred Nowak wrote:

 void main(){
   struct data{
     bit b1=-1;
     bit b2=2;
   }
 }
 
 dmd 0.79, win98SE.
[...] Same thing with `union'. So long.
Jan 30 2004