You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
emit-c: generic struct instantiations reached only through methods/fields are not emitted as C types (Wrap_str_, Box_Node_, BTreeMap_i32__str_ unknown type name) #1562
Found while checking D61 (#1480) backend parity; the baseline (main ae609cd) compiler emits the same C, so this predates D61.
type Wrap[T] { value: T }
impl[T] Debug for Wrap[T]:
fn debug_str() -> str: "wrapped"
fn main:
let w = Wrap { value: "x" }
print(w.debug_str())
with build --emit-c then cc: error: unknown type name Wrap_str_ (the prototype with_str Wrap_debug_str__receiver__...(const Wrap_str_* _1) precedes any definition). Same for type Node { next: Option[Box[Node]] } (Box_Node_) and a BTreeMap[i32, str] (BTreeMap_i32__str_) even without any formatting. Together with #1434 (HashMap traversal) these are the emit-c gaps that keep the D61 map/Box/generic-impl fixtures LLVM-only; every fixture the C backend can compile prints byte-identical output.
Activity
emit-c: a declared generic struct's instance is a C struct; std Box[T…
C backend and modeled-C fixes: map loops, generic structs, view compa…