SpacetimeDB icon indicating copy to clipboard operation
SpacetimeDB copied to clipboard

TypeScript SDK codegen: complex types lack proper parentheses

Open gefjon opened this issue 8 months ago • 1 comments

From a report on Discord.

The Rust type Vec<Vec<Option<u32>> gets codegenned as number | undefined[][]. It should instead be (number | undefined)[][]. Likely the simplest fix to this is to unconditionally print parens around the element-type of array types, so that we print ((number | undefined)[])[]. I am unsure if TypeScript has other type operators that can cause problems in this way.

gefjon avatar Apr 02 '25 13:04 gefjon

Ah, this must be my bad. Apologies!

cloutiertyler avatar Apr 02 '25 23:04 cloutiertyler