Bug 3295 – range's "front" property can not be an enum

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-09-03T13:29:00Z
Last change time
2015-06-09T01:28:07Z
Keywords
rejects-valid
Assigned to
nobody
Creator
2korden

Comments

Comment #0 by 2korden — 2009-09-03T13:29:16Z
struct SomeInfiniteRange { enum front = 42; // not allowed enum empty = false; // allowed void popFront() {} } struct SomeContainer { auto opSlice() { return SomeInfiniteRange(); } } class Test { void test() { foreach (int f; _foo[]) { // do nothing } } private SomeContainer _foo; } test.d(21): Error: no property 'opApply' for type 'SomeInfiniteRange' test.d(21): Error: function expected before (), not __error of type int
Comment #1 by yebblies — 2011-06-15T22:52:08Z
*** This issue has been marked as a duplicate of issue 5403 ***