← Back to index
|
Original Bugzilla link
Bug 19994 – Can't nest self-referential Algebraic types
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-06-22T13:59:04Z
Last change time
2019-07-08T03:15:10Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus
Comments
Comment #0
by snarwin+bugzilla — 2019-06-22T13:59:04Z
import std.variant; import std.meta: AliasSeq; alias Inner = Algebraic!(This*); alias Outer = Algebraic!(Inner, This*); static assert(is(Outer.AllowedTypes == AliasSeq!(Inner, Outer*))); --- $ dmd -c example.d /usr/include/dmd/phobos/std/typecons.d(8730): Error: template instance `std.typecons.ReplaceType!(This, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, U!(8LU, VariantN!(16LU, VariantN!(8LU, This*), This*)*)*)*)*)*)*)*)*)*)*)*)*)*), U!(8LU, VariantN!(16LU, VariantN!(8LU, This*), This*)*)*)` recursive expansion To avoid this error, Algebraic should not attempt to replace occurrences of This that appear inside other instances of Algebraic.
Comment #1
by dlang-bot — 2019-06-22T15:47:27Z
@pbackus created dlang/phobos pull request #7084 "Fix issue 19994 - Can't nest self-referential Algebraic types" fixing this issue: - Fix issue 19994 - Can't nest self-referential Algebraic types
https://github.com/dlang/phobos/pull/7084
Comment #2
by dlang-bot — 2019-07-08T03:15:10Z
dlang/phobos pull request #7084 "Fix issue 19994 - Can't nest self-referential Algebraic types" was merged into master: - 8124b17e2c24e1b67cb7a40dcb80f460ef6825f1 by Paul Backus: Fix issue 19994 - Can't nest self-referential Algebraic types
https://github.com/dlang/phobos/pull/7084