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
Exported generator returns wrong values under -shared: __decls prints the boxed generator object as a value tuple #314
Assertion failed: gendecl (an older build: no done.)
-jit -shared
passes
Cause
The declaration text embedded in the library (__decls) prints the generator's return type as a plain value tuple:
@dllimport
let gen : () => {.step:s32, next(): {value:s32, done:boolean}};
The importer reads that back as !ts.tuple<{"step",si32},{"next",...}>, a value. The library's generator wrapper returns a boxed object (!ts.object<!ts.tuple<...>>, see the generator object-wrapper change in #245). The two sides disagree on the return value's layout.
The printed field name also keeps the internal .step dot.
Likely fix area: MLIRDeclarationPrinter, printing an ObjectType wrapping a tuple as a reference type that reads back boxed. The static and JIT paths don't go through __decls, which is why they pass.
Activity