Thread overview
[Issue 873] New: Scope dependant compilation error
Jan 23, 2007
d-bugmail
Jan 23, 2007
d-bugmail
[Issue 873] Scope-dependent compilation error
Mar 07, 2011
Stewart Gordon
Jun 19, 2013
Don
January 23, 2007
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
        }
}


-- 

January 23, 2007
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


-- 

March 07, 2011
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: -------
June 19, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=873


Don <clugdbug@yahoo.com.au> changed:

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


--- Comment #3 from Don <clugdbug@yahoo.com.au> 2013-06-19 03:06:32 PDT ---
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: -------