Bug 873 – Scope-dependent compilation error

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-01-22T19:00:00Z
Last change time
2014-02-15T13:13:16Z
Keywords
rejects-valid
Assigned to
nobody
Creator
boris.kolar

Comments

Comment #0 by boris.kolar — 2007-01-22T19:00:32Z
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 } }
Comment #1 by thomas-dloop — 2007-01-23T07:46:01Z
Comment #2 by smjg — 2011-03-07T06:44:48Z
What does "foo.init" mean? Looks to me like invalid code.
Comment #3 by clugdbug — 2013-06-19T03:06:32Z
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.