www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - hidden truncation

I was looking over the types page for D on the web site.  From the 
description there, I'd expect the assignment statements below and the 
call to generate an error, since each of these loses information.  It 
seems that there should be a cast required when information is lost.

void foo( int i, float f)

int main()
  real  r;
  float f;
  int   i;
  long  l;
  f = r;
  i = l;
  foo( l, r );
  return( 1 );
Jul 28 2004