How to reproduce:
- Install TypeScript 4.8.4 as a project dependency.
- Enable set "typescript.inlayHints.includeInlayParameterNameHints" to "all".
- Checks the inferred type for
nums:
class Bad {
nums = combineLatest([of(1), of(2), of(3)]).pipe(
map(([a, b, c]) => a + b + c), // <- trailing comma
)
}
Reproducer: tslangserver-report.zip.
Expected:
The type is inferred as Observable<number>.
Observed:
nums infers to Observable<unknown>.
Notes:
I'm using the service via the https://github.com/sublimelsp/LSP-typescript in Sublime Text 4. Disabling the setting or removing the comma fixes the inference. VSCode with language server version set to 4.8.4 infers everything correctly. This is mildly annoying as Prettier adds dangling commas by default and I can't change the project TS version yet. I can point the server to use TS 5, but I figured the bug's worth reporting anyway,