You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2026/05/30 15:16:00 UTC
[jira] [Created] (THRIFT-6061) Capability for recursive structs missing
Jens Geyer created THRIFT-6061:
----------------------------------
Summary: Capability for recursive structs missing
Key: THRIFT-6061
URL: https://issues.apache.org/jira/browse/THRIFT-6061
Project: Thrift
Issue Type: Bug
Components: D - Compiler
Reporter: Jens Geyer
Today the D code generation is not possible with recursive structures.
For example test/Recursive.thrift it would produce code like
{code}
struct CoRec {
CoRec2 other;
}
struct CoRec2 {
CoRec other;
}
void main()
{
}
{code}
Which gives
{code}
onlineapp.d(6): Error: struct `onlineapp.CoRec` no size because of forward reference
CoRec other;
^
{code}
Reason is that D uses structs which (in most/all languages) are embedded and thus donot allow such constructs. Unfortunately thne D compiler does not offer any option to switch to classes instead nmor to circumvent the issue in otehr ways.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)