Thread overview
-831 is not an expression
Jan 11, 2005
Brian Hjøllund
Jan 11, 2005
Thomas Kuehne
Jan 11, 2005
Brian Hjøllund
Jan 11, 2005
Thomas Kuehne
January 11, 2005
I've discovered what I consider to be a bug.
I used the search functionality provided by the site to see if any other posts
had been made about it, and I was unable to find any. If I missed it, I
apologize for this redundant post.
Anyway, this throws the above error:

const int RBN_FIRST = -831;

Apparently, I'm not allowed to assign negative values to a const variable. Is this a bug, or by design? If so, why?

/Brian
January 11, 2005
Brian Hjøllund wrote:
> Anyway, this throws the above error:
> 
> const int RBN_FIRST = -831;

I can remember seeing that error message in a similar situation. The problem is that the line alone doesn't throw the message. (Linux dmd-110/gdc-0.10)

Thomas


January 11, 2005
>The problem is that the line alone doesn't throw the message.

You're right, I just tried it on it's own. So I trimmed the source a bit, and finally came up with the following:

int main()
{
return 0;
}

const int RBN_FIRST = -831;

enum
{
RBN_HEIGHTCHANGE = RBN_FIRST
}

I'm using DMD 0.110 on Windows XP SP2, Danish edition

/Brian
January 11, 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Added to DStress as http://dstress.kuehne.cn/compile/const_12.d http://dstress.kuehne.cn/compile/const_13.d

Thomas


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

iD8DBQFB4/9I3w+/yD4P9tIRAgCeAKCAvH9uaEjIuRb+hx7GyUQkVghaCgCghikv
ZTgRqafY+4a8MAjePxXrd1A=
=6Mx3
-----END PGP SIGNATURE-----