Thread overview
[Issue 572] New: syntax error when using template instantiation with typeof
Nov 19, 2006
d-bugmail
[Issue 572] parse error when using template instantiation with typeof
Nov 19, 2006
d-bugmail
Nov 25, 2006
Thomas Kuehne
[Issue 572] parse error when using template instantiation with typeof
Jul 10, 2008
d-bugmail
November 19, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=572

           Summary: syntax error when using template instantiation with
                    typeof
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: lovesyao@hotmail.com


class Test{
  static const test2=1;
  template test(){
    const int test=1;
  }
}

void main(){
  auto a=new Test;
  static assert(typeof(a).test2==1);//ok
  alias typeof(a) t;
  static assert(t.test!()==1);//ok
  static assert(typeof(a).test!()==1);//syntax error
}


-- 

November 19, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=572





------- Comment #1 from lovesyao@hotmail.com  2006-11-19 04:17 -------
Created an attachment (id=79)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=79&action=view)
patch(I didn't do regression test)


-- 

November 25, 2006
d-bugmail@puremagic.com schrieb am 2006-11-19:
> http://d.puremagic.com/issues/show_bug.cgi?id=572

> class Test{
>   static const test2=1;
>   template test(){
>     const int test=1;
>   }
> }
>
> void main(){
>   auto a=new Test;
>   static assert(typeof(a).test2==1);//ok
>   alias typeof(a) t;
>   static assert(t.test!()==1);//ok
>   static assert(typeof(a).test!()==1);//syntax error
> }

Added to DStress as http://dstress.kuehne.cn/compile/t/typeof_15_A.d http://dstress.kuehne.cn/compile/t/typeof_15_B.d http://dstress.kuehne.cn/compile/t/typeof_15_C.d

Thomas


July 10, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=572


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from bugzilla@digitalmars.com  2008-07-09 22:36 -------
Fixed dmd 1.032 and 2.016


--