www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - MixinIdentifier can't be used within a class?

reply Roel Mathys <roel.mathys yucom.be> writes:
This code:


template Foo() { const int x = 5; } class C { mixin Foo F; } void main() { C c = new C; printf("%d\n",c.F.x); } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< gives the following output:

parse property semantic property semantic2 property semantic3 property D:\apps\D\templates\property.d(37): c.Foo!() F is not a declaration <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< regards, roel
May 24 2004
parent "Ivan Senji" <ivan.senji public.srce.hr> writes:
Had the same problem posted in
"mixin bug? multiple mixin declaration problem"

Walter said it is a bug.

"Roel Mathys" <roel.mathys yucom.be> wrote in message
news:c8tgbc$7bb$1 digitaldaemon.com...
 This code:

  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 template Foo()
 {
      const int x = 5;
 }

 class C
 {
      mixin Foo F;
 }

 void main()
 {
      C c = new C;

      printf("%d\n",c.F.x);
 }
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 gives the following output:

  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 parse     property
 semantic  property
 semantic2 property
 semantic3 property
 D:\apps\D\templates\property.d(37): c.Foo!() F is not a declaration
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 regards,
 roel
May 24 2004