Bug 9436 – enum cannot be forward referenced with cyclic imports and mixin
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-01T03:03:00Z
Last change time
2013-02-02T13:28:05Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
r.sagitario
Comments
Comment #0 by r.sagitario — 2013-02-01T03:03:45Z
With dmd from github, this causes an error (reduced by dustmite):
///////////
module aggr;
import type;
class Aggregate : Type
{
}
class Class {
}
///////////
module interpret;
import type;
import aggr;
class ReferenceValueT(T)
{
void doCast()
{
auto x = Type.ConversionFlags.kAllowBaseClass;
}
}
class ClassValue : ReferenceValueT!Class
{
}
//////////
module node;
import aggr;
template ForwardCtor()
{
}
//////////
module type;
import node;
class Type {
mixin ForwardCtor!();
enum ConversionFlags
{
kAllowBaseClass = 0
}
}
>dmd -c interpret.d
type.d(12): Error: enum type.Type.ConversionFlags is forward referenced when loo
king for 'kAllowBaseClass'
interpret.d(9): Error: no property 'kAllowBaseClass' for type 'int'
This used to compile until a couple of days ago.