[Issue 11522] mixing template mixins of template functions creates issues for dmd

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 15 13:50:23 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11522



--- Comment #2 from Phil Lavoie <maidenphil at hotmail.com> 2013-11-15 13:50:22 PST ---
(In reply to comment #1)
> (In reply to comment #0)
> > mixin template innerMixin() {
> > 
> >   void someFunc( string s )() if( s == "tata" ) {
> > 
> >   }
> > 
> > }
> > 
> > mixin template outerMixin() {
> > 
> >   //If you comment out this function, it compiles and work.
> >   void someFunc( string s )() if( s == "toto" ) {
> > 
> >   }
> > 
> > 
> >   mixin innerMixin;
> > 
> > }
> > 
> > void main( string[] args ) {
> > 
> >   mixin outerMixin;
> > 
> >   static assert( __traits( compiles, mixin( "someFunc!\"tata\"()" ) ) ); //Does
> > not pass.
> > }
> > 
> > Shouldn't it work? Version is 2.064
> 
> K, if you move the "outer" "someFunc" into its own mixin template, like such:
> 
> mixin template otherInnerMixin() {
> 
>   void someFunc( string s )() if( s == "toto" ) {
> 
>   }
> 
> }
> 
> and change "outerMixin" for this:
> 
> mixin template outerMixin() {
> 
>   mixin innerMixin;
>   mixin otherInnerMixin;
> 
> }
> 
> Then it works.

Scratch that, it's working for this short example but not in my real world
problem.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list