Skip to content

Test case to reproduce the crash in typescript-go#2039Β #62741

@jthemphill

Description

@jthemphill

πŸ”Ž Search Terms

microsoft/typescript-go#2039

πŸ•— Version & Regression Information

⏯ Playground Link

https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABDKBTATgQzQFRABwBtUBnACigOJIC5EBtEqdGMAcwBpEmX2BdenwCUiAN4AoRFMSUipAHTA46AKKYIACzIURAXgB8YgL5DxRoA

πŸ’» Code

/// <reference path="fourslash.ts" />

//// function iterateTuples(tuples: [string, string][]) {
////     tuples.forEach((t) => {})
//// }

verify.baselineInlayHints(undefined, {
  includeInlayVariableTypeHints: true,
  includeInlayParameterNameHints: "all",
  includeInlayFunctionParameterTypeHints: true,
});

πŸ™ Actual behavior

On TypeScript, this works as intended.

On the TypeScript Go port, we get the error seen in microsoft/typescript-go#2039:

Unhandled case in Node.ElementList: KindTupleType

πŸ™‚ Expected behavior

// === Inlay Hints ===
    tuples.forEach((t) => {})
                   ^
{
  "text": "callbackfn:",
  "position": 72,
  "kind": "Parameter",
  "whitespaceAfter": true
}

    tuples.forEach((t) => {})
                     ^
{
  "text": ": [string, string]",
  "position": 74,
  "kind": "Type",
  "whitespaceBefore": true
}

Additional information about the issue

See #62740 for the PR that adds this test case and baseline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions