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: nob...@puremagic.com
          Reporter: mixedavocado+dl...@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?)

--

Reply via email to