www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1883] New: templates instantiated as real gives incorrect values

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1883

           Summary: templates instantiated as real gives incorrect values
           Product: D
           Version: 2.011
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: diboss hotmail.com


Here's a simplified example:

template factorial(real n) {
     const real factorial = 1;
}

void main() {
     writefln(factorial!(5));
}

outputs: -0 instead of 1.
This is different than behaviour in 1.027.


-- 
Feb 29 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1883





------- Comment #1 from bugzilla digitalmars.com  2008-03-01 14:14 -------
This is actually a bug in writefln().


-- 
Mar 01 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1883


andrei metalanguage.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from andrei metalanguage.com  2008-03-07 00:30 -------
Fixed in 2.012.


-- 
Mar 06 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1883





------- Comment #3 from bugzilla digitalmars.com  2008-03-07 00:39 -------
Fixed dmd 2.012


-- 
Mar 06 2008