digitalmars.D.bugs - [Issue 11522] New: mixing template mixins of template functions creates issues for dmd
- d-bugmail puremagic.com (33/33) Nov 15 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11522
- d-bugmail puremagic.com (17/46) Nov 15 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11522
- d-bugmail puremagic.com (8/59) Nov 15 2013 https://d.puremagic.com/issues/show_bug.cgi?id=11522
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
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.064K, 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
https://d.puremagic.com/issues/show_bug.cgi?id=11522 PST ---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: -------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.064K, 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.
Nov 15 2013