www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1328] New: Default class template parameters don't work as expected

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

           Summary: Default class template parameters don't work as expected
           Product: D
           Version: 1.019
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: leo.dahlmann gmail.com


<code>
class Foo(T = char)
{

}

void main()
{
        Foo f; // Line 8
}
</code>

test.d(8): class test.Foo(T = char) is used as a type
test.d(8): variable test.main.f voids have no value

It only compiles if you use Foo!() as the type, but I think Foo should work,
too.


-- 
Jul 10 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1328


deewiant gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.019                       |1.018




------- Comment #1 from deewiant gmail.com  2007-07-10 08:20 -------
Setting version to 1.018: 1.019 isn't out yet.


-- 
Jul 10 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1328


fvbommel wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|                            |spec




------- Comment #2 from fvbommel wxs.nl  2007-07-10 08:46 -------
This would be nice to have but it's an enhancement request, not a bug. Current
behavior is according to spec and AFAIK as designed.

Marked as enhancement and spec-related (since it would have to be changed to
implement this)


-- 
Jul 10 2007