eclipse-cdt-cloud / eclipse-cdt-cloud/tsp-typescript-client

Code needs some updates to compile with never typescript versions (TS2322)

Open
#140 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
9
Forks
23
PR merge metrics
No merged PRs in 30d

Description

### Bug Description:

The errors below were seen when typescript was updated to the latest v5.x:

```
tsp-typescript-client:
tsp-typescript-client: tsp-typescript-client: $ tsc
Error: tsp-typescript-client: src/protocol/serialization.ts(153,19): error TS2322: Type 'any[]' is not assignable to type 'T'.
tsp-typescript-client: 'T' could be instantiated with an arbitrary type which could be unrelated to 'any[]'.
Error: tsp-typescript-client: src/protocol/serialization.ts(169,11): error TS2322: Type 'Deserialized & {}' is not assignable to type 'T'.
tsp-typescript-client: 'T' could be instantiated with an arbitrary type which could be unrelated to 'Deserialized & {}'.
tsp-typescript-client:
tsp-typescript-client: tsp-typescript-client: error Command failed with exit code 2.
```

Seems related to https://github.com/microsoft/TypeScript/pull/56941.

Reading quickly it seems that TypeScript, starting around v5.8.x, became more strict about generic types used in return statements. I think that fixing this would entail making a couple of return types "tighter" to satisfy the new check.

### Steps to Reproduce:

1. Update the version range for dependency typescript to the latest v5.x
2. try to build
3. see if you get typescript error TS2322

### Additional Information

- Operating System:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.