Bug 1328 – Default class template parameters don't work as expected
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-07-10T08:01:00Z
Last change time
2014-02-16T15:22:42Z
Keywords
spec
Assigned to
nobody
Creator
leo.dahlmann
Comments
Comment #0 by leo.dahlmann — 2007-07-10T08:01:42Z
<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.
Comment #1 by matti.niemenmaa+dbugzilla — 2007-07-10T08:20:12Z
Setting version to 1.018: 1.019 isn't out yet.
Comment #2 by fvbommel — 2007-07-10T08:46:10Z
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)
Comment #3 by clugdbug — 2012-09-26T00:51:01Z
*** This issue has been marked as a duplicate of issue 1012 ***