Skip to content

Quick info shows wrong type for type parameters instantiated with their defaultΒ #46774

Closed
@heretic-G

Description

@heretic-G

Bug Report

πŸ”Ž Search Terms

Parameter type prompt error

πŸ•— Version & Regression Information

4.5.0-beta
4.4.4

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

function demo <T extends unknown = string, B extends unknown = string> (a: T,b: B) {}

demo<boolean>(true, 2) // T: boolean, B: unknown The type has been limited to string, but the prompt is unknown

demo<boolean>(true, '2')

πŸ™ Actual behavior

image

πŸ™‚ Expected behavior

Show the correct type

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Type DisplayBugs relating to showing types in Quick Info/Tooltips, Signature Help, or Completion InfoEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions