www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11522] New: mixing template mixins of template functions creates issues for dmd

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11522

           Summary: mixing template mixins of template functions creates
                    issues for dmd
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: maidenphil hotmail.com



PST ---
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 15 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11522




PST ---

 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. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 15 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11522




PST ---


 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: -------
Nov 15 2013