digitalmars.D - Bracketed expression == convert?
- Yossarian (10/10) Jul 02 2006 consider following code:
 - Bruno Medeiros (5/18) Jul 02 2006 That compiles fine here, with DMD .162 .
 - Deewiant (3/16) Jul 02 2006 It is Bug 34, which was fixed in DMD 0.161:
 
consider following code:
import std.stdio;
const int t = 0;
void main()
{
	writefln("%d", (t) - 1);
}
(i think it's completelly legal, but compiler explains:
C style cast illegal, use cast(t)-1
is it a bug, or a feature?
 Jul 02 2006
Yossarian wrote:
 consider following code:
 
 import std.stdio;
 const int t = 0;
 void main()
 {
     writefln("%d", (t) - 1);
 }
 
 (i think it's completelly legal, but compiler explains:
 C style cast illegal, use cast(t)-1
 
 is it a bug, or a feature?
That compiles fine here, with DMD .162 .
-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
 Jul 02 2006
Yossarian wrote:
 consider following code:
 
 import std.stdio;
 const int t = 0;
 void main()
 {
     writefln("%d", (t) - 1);
 }
 
 (i think it's completelly legal, but compiler explains:
 C style cast illegal, use cast(t)-1
 
 is it a bug, or a feature?
It is Bug 34, which was fixed in DMD 0.161:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=34
 Jul 02 2006








 
 
 
 Bruno Medeiros <brunodomedeirosATgmail SPAM.com> 