www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16164] New: struct(class)'s template is NOT available the

https://issues.dlang.org/show_bug.cgi?id=16164

          Issue ID: 16164
           Summary: struct(class)'s template is NOT available the default
                    type
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: mixedavocado+dlang gmail.com

void main(){
    S s;
}
struct S( T = size_t )
{
    T buf;
}
 Error: struct temp.S(T = size_t) is used as a type
difficult to understand because there is no relation of default Type, and difficult to notice rewriting S to S!size_t(work correctly). I think that DMD compiler should... use Template-Type-Parameter-Default and not return error (enh?bug?) or return error message about default value with above message (bug) or return error message easier (enh?bug?) --
Jun 11 2016