Skip to content

TypeScript SDK codegen: complex types lack proper parentheses #2541

@gefjon

Description

@gefjon

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions