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






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 next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=873




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
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=873


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



This now compiles in all cases. I think this is incorrect, so I have opened
http://d.puremagic.com/issues/show_bug.cgi?id=10413

But the original bug in this report is fixed -- scope no longer makes a
difference. Almost certainly there were variations of this bug which weren't
invalid.

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