Skip to content

Contextual type of 'any' should be ignored #6190

Description

getContextuallyTypedParameterType should return undefined instead of any

let x: { f(a, b): any, g(): any } = {
    f: (a = "none", b) => a.length, 
    g: (a = "none", b) { return a.length }
}

For both f and g, the parameter a: any but should be a: string.

I also ran into this with implemented/inherited functions in PR #6118.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptBy DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions