[Issue 9436] New: enum cannot be forward referenced with cyclic imports and mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 1 03:03:47 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9436

           Summary: enum cannot be forward referenced with cyclic imports
                    and mixin
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: r.sagitario at gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2013-02-01 03:03:45 PST ---
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.

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


More information about the Digitalmars-d-bugs mailing list