Skip to content

checker.getTypeAtLocation for ExpressionWithTypeArguments returns an error any typeΒ #49223

Closed
@bradzacher

Description

@bradzacher

Bug Report

πŸ”Ž Search Terms

ExpressionWithTypeArguments, getTypeAtLocation, checker, api, error any.

πŸ•— Version & Regression Information

  • This is a bug in the @next version of TS.

⏯ Playground Link

Because this is a bug with the API specifically, here is a link to the ast explorer.
https://ts-ast-viewer.com/#code/GYVwdgxgLglg9mABAWwIYGsCmAhOAPAHgBUA+ACgDdUAbETALkSIEpEBvAKEUQCdMoQPJG0RVamRAF8A3B0kcOEBAGcoKDJgDKUHjDABzXHkQBedViMFVugyWlA

image

πŸ’» Code

function makeBox<T>(value: T) {
  return { value };
}

const makeStringBox = makeBox<string>;


const sett = Set<string>;

πŸ™ Actual behavior

checker.getTypeAtLocation for the ExpressionWithTypeArguments node returns an error any.

πŸ™‚ Expected behavior

checker.getTypeAtLocation for the ExpressionWithTypeArguments node returns the relevant type of the expression, which would be (value: string) => {value: string}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions