www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 873] New: Scope dependant compilation error

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

           Summary: Scope dependant compilation error
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: boris.kolar globera.com


For struct inside function scope, compilation error occours. For the same
struct outside the scope, no error is reported. Example:

template Factory() {
        Foo foo() {
                return foo.init;
        }
}

struct Foo {
        mixin Factory; // ok
}

void main() {
        struct Foo {
                mixin Factory; // compiler error
        }
}


-- 
Jan 22 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=873





------- Comment #1 from thomas-dloop kuehne.cn  2007-01-23 07:46 -------
Added to DStress as
http://dstress.kuehne.cn/run/m/mixin_26_A.d
http://dstress.kuehne.cn/run/m/mixin_26_B.d


-- 
Jan 23 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=873



--- Comment #2 from Stewart Gordon <smjg iname.com> 2011-03-07 06:44:48 PST ---
What does "foo.init" mean?  Looks to me like invalid code.

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