-
Notifications
You must be signed in to change notification settings - Fork 13.3k
checker.getTypeAtLocation for ExpressionWithTypeArguments returns an error any typeΒ #49223
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
Bug Report
π Search Terms
ExpressionWithTypeArguments, getTypeAtLocation, checker, api, error any.
π Version & Regression Information
- This is a bug in the
@nextversion 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
π» 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}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
