Bug 9434 – regression(head): template mixin contents mixed in multiple times
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-31T13:54:00Z
Last change time
2013-01-31T18:45:35Z
Assigned to
nobody
Creator
timon.gehr
Comments
Comment #0 by timon.gehr — 2013-01-31T13:54:06Z
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.)
Comment #1 by k.hara.pg — 2013-01-31T16:52:36Z
*** This issue has been marked as a duplicate of issue 9435 ***
Comment #2 by github-bugzilla — 2013-01-31T18:45:35Z