www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 572] New: syntax error when using template instantiation with typeof

reply d-bugmail puremagic.com writes:
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
}


-- 
Nov 19 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=572






Created an attachment (id=79)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=79&action=view)
patch(I didn't do regression test)


-- 
Nov 19 2006
prev sibling next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 -----BEGIN PGP SIGNATURE----- iD8DBQFFaEh6LK5blCcjpWoRAiWBAJ4xw9WFGZ90lO6mSQ5baAqejlWtYACgjre2 rHPttb/ti4zwesxXCR5Ir50= =gX9g -----END PGP SIGNATURE-----
Nov 25 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=572


bugzilla digitalmars.com changed:

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





Fixed dmd 1.032 and 2.016


-- 
Jul 09 2008