Skip to content

Contextual type of 'any' should be ignored #6190

Closed
@sandersn

Description

@sandersn

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.

Metadata

Metadata

Assignees

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