www.digitalmars.com         C & C++   DMDScript  

D - bug report(s) on alpha 0.01

reply "Pavel Minayev" <evilone omen.ru> writes:
The code was:


    // inter.d

    interface IStream
    {
     bit read(void* buffer, int size);
    }

    interface OStream
    {
     bit write(void* buffer, int size);
    }


  > mars -I..\src\phobos inter.d
  Assertion failure: 'structsize >= 8' on line 425 in file 'glue.c'

Seems to happen every time interfaces are used.

BTW. Could you pleeease make the "bool" data type - might be just
an always-defined enum bool { false, true = !false }!
Dec 10 2001
next sibling parent reply "Pavel Minayev" <evilone omen.ru> writes:
    int main(char[][])

    "no identifier for parameter 1 of main()"


Hey, you said it's possible to omit parameter names! =)
Dec 10 2001
parent "Walter" <walter digitalmars.com> writes:
At least it's a good error message!

"Pavel Minayev" <evilone omen.ru> wrote in message
news:9v3443$1k4n$1 digitaldaemon.com...
     int main(char[][])

     "no identifier for parameter 1 of main()"


 Hey, you said it's possible to omit parameter names! =)
Dec 16 2001
prev sibling next sibling parent reply "Pavel Minayev" <evilone omen.ru> writes:
Something's definitely wrong!

    // file.d (Phobos)
    class File
    {
        ...
        static void write(char[] name, char[] buffer)
        ...
    }

    // my program
    char[] pc, dc;
    ...
    File.write(pc, dc);

Compiler output:

 "..\src\phobos\file.d(77): no function write matches argument list (char
[],char [])"

????????????????
Dec 10 2001
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Pavel Minayev" <evilone omen.ru> wrote in message
news:9v344o$1k4n$2 digitaldaemon.com...

     char[] pc, dc;
     ...
     File.write(pc, dc);
Even more funny: char[] pc; char[] dc; ... File.write(pc, dc); Now it works!?
Dec 10 2001
parent "Walter" <walter digitalmars.com> writes:
"Pavel Minayev" <evilone omen.ru> wrote in message
news:9v34jn$1kjl$1 digitaldaemon.com...
 "Pavel Minayev" <evilone omen.ru> wrote in message
 news:9v344o$1k4n$2 digitaldaemon.com...

     char[] pc, dc;
     ...
     File.write(pc, dc);
Even more funny: char[] pc; char[] dc; ... File.write(pc, dc); Now it works!?
You're right. I need to work on the declaration parsing for multiple names. It was working like in C, but then I just changed it, and it's broken.
Dec 14 2001
prev sibling next sibling parent reply "Pavel Minayev" <evilone omen.ru> writes:
The test snippet was:

    int main(char[][] args)
    {
     char[] s, t;
     s ~= t;
     s ~= "test";
    }

    > mars -I..\src\phobos concat.d
    concat.d(5): can only concatenate arrays

Note that appending t to s works, the problem is
with constant strings.

Also, not a bug really (although not sure): why
can't elements, rather then arrays, be concatenated/
appended?

    char[] s;
    s = 'a' ~ 'r'; // "ar"
    s = 'm' ~ s;   // "mar"
    s ~= 's';      // "mars"

Since binary ~ is not used elsewhere, I don't see
any reasons why this shouldn't work.

BTW. Having used it for a while, ~ seems quite suitable
for concatenation. I take my request (that one to change
it with something else) away, it's fine already.
Dec 11 2001
parent "Walter" <walter digitalmars.com> writes:
Ok, I'll work on the problems you found. I agree ~ does take a little
getting used to.

"Pavel Minayev" <evilone omen.ru> wrote in message
news:9v5jr1$c5a$1 digitaldaemon.com...
 The test snippet was:

     int main(char[][] args)
     {
      char[] s, t;
      s ~= t;
      s ~= "test";
     }

     > mars -I..\src\phobos concat.d
     concat.d(5): can only concatenate arrays

 Note that appending t to s works, the problem is
 with constant strings.

 Also, not a bug really (although not sure): why
 can't elements, rather then arrays, be concatenated/
 appended?

     char[] s;
     s = 'a' ~ 'r'; // "ar"
     s = 'm' ~ s;   // "mar"
     s ~= 's';      // "mars"

 Since binary ~ is not used elsewhere, I don't see
 any reasons why this shouldn't work.

 BTW. Having used it for a while, ~ seems quite suitable
 for concatenation. I take my request (that one to change
 it with something else) away, it's fine already.
Dec 11 2001
prev sibling next sibling parent "Walter" <walter digitalmars.com> writes:
In digging into this, I find I screwed up how interfaces are implemented.
It'll take a couple days to rework it all. Please be patient! -Walter

"Pavel Minayev" <evilone omen.ru> wrote in message
news:9v3243$1ivg$1 digitaldaemon.com...
 The code was:


     // inter.d

     interface IStream
     {
      bit read(void* buffer, int size);
     }

     interface OStream
     {
      bit write(void* buffer, int size);
     }


   > mars -I..\src\phobos inter.d
   Assertion failure: 'structsize >= 8' on line 425 in file 'glue.c'

 Seems to happen every time interfaces are used.

 BTW. Could you pleeease make the "bool" data type - might be just
 an always-defined enum bool { false, true = !false }!
Dec 12 2001
prev sibling parent reply "Pavel Minayev" <evilone omen.ru> writes:
Just try to compile the following simple snippet:

    class Apple { }
    class Orange { }

    void Eat(Apple a) { }
    void Eat(Orange o) { }

    int main() { }

D doesn't allow to overload Eat() for Oranges...
Dec 13 2001
parent "Walter" <walter digitalmars.com> writes:
That's definitely a bug in the D compiler. The compiler should also issue an
error for not returning a value from int main().

"Pavel Minayev" <evilone omen.ru> wrote in message
news:9varco$pa8$1 digitaldaemon.com...
 Just try to compile the following simple snippet:

     class Apple { }
     class Orange { }

     void Eat(Apple a) { }
     void Eat(Orange o) { }

     int main() { }

 D doesn't allow to overload Eat() for Oranges...
Dec 14 2001