D - bug report(s) on alpha 0.01
- Pavel Minayev (15/15) Dec 10 2001 The code was:
- Pavel Minayev (3/3) Dec 10 2001 int main(char[][])
- Walter (3/6) Dec 16 2001 At least it's a good error message!
- Pavel Minayev (16/16) Dec 10 2001 Something's definitely wrong!
- Pavel Minayev (7/10) Dec 10 2001 Even more funny:
- Walter (4/14) Dec 14 2001 You're right. I need to work on the declaration parsing for multiple nam...
- Pavel Minayev (23/23) Dec 11 2001 The test snippet was:
- Walter (4/27) Dec 11 2001 Ok, I'll work on the problems you found. I agree ~ does take a little
- Walter (4/19) Dec 12 2001 In digging into this, I find I screwed up how interfaces are implemented...
- Pavel Minayev (7/7) Dec 13 2001 Just try to compile the following simple snippet:
- Walter (4/11) Dec 14 2001 That's definitely a bug in the D compiler. The compiler should also issu...
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
int main(char[][])
"no identifier for parameter 1 of main()"
Hey, you said it's possible to omit parameter names! =)
Dec 10 2001
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
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
"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
"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...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.char[] pc, dc; ... File.write(pc, dc);Even more funny: char[] pc; char[] dc; ... File.write(pc, dc); Now it works!?
Dec 14 2001
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
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
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
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
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









"Walter" <walter digitalmars.com> 