digitalmars.D.bugs - [Issue 15963] New: Hidden unresolved forward reference issue in
- via Digitalmars-d-bugs (52/52) Apr 27 2016 https://issues.dlang.org/show_bug.cgi?id=15963
https://issues.dlang.org/show_bug.cgi?id=15963 Issue ID: 15963 Summary: Hidden unresolved forward reference issue in std.uni Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: accepts-invalid Severity: normal Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: k.hara.pg gmail.com Minimized test case from std.uni module code: void main()//unittest { Grapheme()[]; } struct SliceOverIndexed(T) { enum assignableSlice = is(typeof({ T.init[0..0] = Item.init; })); alias Item = typeof(T.init[0]); size_t from, to; T* arr; } SliceOverIndexed!T sliceOverIndexed(T)(size_t a, size_t b, T* x) { return SliceOverIndexed!T(a, b, x); } struct Grapheme { dchar opIndex(size_t index) const pure nothrow nogc { return 'a'; } system auto opSlice(size_t a, size_t b) pure nothrow nogc { return sliceOverIndexed(a, b, &this); } system auto opSlice() pure nothrow nogc { return sliceOverIndexed(0, 0, &this); } } Two opSlice auto functions in Grapheme depends on a return type of template function sliceOverIndexed. But the instantiated type SliceOverIndexed!Grapheme depends on is(typeof({ Grapheme.opSlice(0, 0) = dchar.init; })). In short, there's an unresolved forward reference issue. The hiding error is a bug of current dmd, but the Phobos code needs to be fixed first. --
Apr 27 2016