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.
Comment #1 by k.hara.pg — 2013-02-01T22:53:56Z
Comment #2 by github-bugzilla — 2013-02-02T12:13:13Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ff9b7b4add6405a58c1410ac5b1bad2299c64456 fix Issue 9436 - enum cannot be forward referenced with cyclic imports and mixin https://github.com/D-Programming-Language/dmd/commit/520b8703f8c8a5b8b477cefe3c7293e3f6271888 Merge pull request #1594 from 9rnsr/fix9436 Issue 9436 - enum cannot be forward referenced with cyclic imports and mixin