[Issue 16164] New: struct(class)'s template is NOT available the default type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jun 11 10:14:29 PDT 2016


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 at puremagic.com
          Reporter: mixedavocado+dlang at 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?)

--


More information about the Digitalmars-d-bugs mailing list