www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9434] New: regression(head): template mixin contents mixed in multiple times

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

           Summary: regression(head): template mixin contents mixed in
                    multiple times
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



To reproduce: dmd expression.d

// expression.d:
import semantic;
template Visitors(){ mixin Semantic!(typeof(this)); }
class Node{    mixin Visitors; }
class Expression: Node{ }
class BinaryExp(TokenType op): Expression{ }
// ---

// semantic.d:
import expression;
enum TokenType{Dot}
template Tok(string type){enum Tok=TokenType.Dot;}
template Semantic(T) { invariant(){ } }
template Semantic(T) if(is(T==BinaryExp!(Tok!"."))){ }
// ===

Output with dmd from head:
semantic.d(4): Error: function
expression.Node.Visitors!().Semantic!(Node).__invariant more than one invariant
for Node
expression.d(2): Error: mixin expression.Node.Visitors!().Semantic!(Node) error
instantiating
expression.d(3): Error: mixin expression.Node.Visitors!() error instantiating

This worked with DMD 2.060. (I assume that the bug was present before, as I
have had similar issues before, and it surfaces because the analysis order is
different.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9434


timon.gehr gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |regression


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9434


Kenji Hara <k.hara.pg gmail.com> changed:

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



*** This issue has been marked as a duplicate of issue 9435 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 31 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9434




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d167d1d4a911c530efeaf7790dcf9a17a4482f25
fix Issue 9434 & 9435 - regression(head): forward reference error

test/compilable/test9434.d and test9435.d are mutually dependent.

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