Thread overview
Internal Error on void[] = void[]
Feb 26, 2005
Lukas Pinkowski
Feb 26, 2005
Derek
Feb 28, 2005
Walter
Mar 18, 2005
Thomas Kuehne
February 26, 2005
I use DMD 0.113 on Linux and the following snippet

void Foo()
{
  void[] bar;
  void[] foo;

  bar.length = 50;
  foo.length = 50;

  for(int i=0; i<50; i++)
  {
    foo[i] = bar[i];
  }
}

gives me

Internal error: ../ztc/cod4.c 352

When you comment out
// foo[i] = bar[i]

It'll compile without errors. It gives me the same error, when casting to void.

Now is this valid D? Or should I use ubyte[] or byte[] instead of void[]?

Greetings,

Lukas
February 26, 2005
> Now is this valid D? Or should I use ubyte[] or byte[] instead of void[]?

I'm not sure if it's valid to set or get the value of a void, but it certainly shouldn't crash the compiler.

You're probably better off using byte[] or ubyte[] instead, because honestly, what IS a void?  ;)


February 26, 2005
On Sat, 26 Feb 2005 17:57:52 +0100, Lukas Pinkowski wrote:

> I use DMD 0.113 on Linux and the following snippet
> 
> void Foo()
> {
>   void[] bar;
>   void[] foo;
> 
>   bar.length = 50;
>   foo.length = 50;
> 
>   for(int i=0; i<50; i++)
>   {
>     foo[i] = bar[i];
>   }
> }
> 
> gives me
> 
> Internal error: ../ztc/cod4.c 352
> 
> When you comment out
> // foo[i] = bar[i]
> 
> It'll compile without errors. It gives me the same error, when casting to void.
> 
> Now is this valid D? Or should I use ubyte[] or byte[] instead of void[]?

Well, ask yourself, are you copying bytes or copying voids (whatever they
are)?

-- 
Derek
Melbourne, Australia
February 28, 2005
It isn't valid code, but it shouldn't crash the compiler.


March 18, 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lukas Pinkowski schrieb am Sat, 26 Feb 2005 17:57:52 +0100:
> I use DMD 0.113 on Linux and the following snippet
>
> void Foo()
> {
>   void[] bar;
>   void[] foo;
> 
>   bar.length = 50;
>   foo.length = 50;
> 
>   for(int i=0; i<50; i++)
>   {
>     foo[i] = bar[i];
>   }
> }
>
> gives me
>
> Internal error: ../ztc/cod4.c 352

Added to DStress as http://dstress.kuehne.cn/nocompile/bug_cod4_352_B.d

Thomas

-----BEGIN PGP SIGNATURE-----

iD8DBQFCOorU3w+/yD4P9tIRArTfAJ9vegfYIRnWHjCADEtQDOVdx+G7OwCeNHVx
wjDle57aEEqa+ThNlu0jSr0=
=5Mfu
-----END PGP SIGNATURE-----