Skip to content

Missing implicit any error in destructuring with computed property #23334

@ajafff

Description

@ajafff

TypeScript Version: 2.9.0-dev.20180411

Search Terms:

Code

// --noImplicitAny
let named = 'foo';
let {[named]: prop} = {prop: 'foo'};

Expected behavior:
Element implicitly has an 'any' type because type '{ prop: string; }' has no index signature.

Actual behavior:
prop is any, but there is no implicit any error

Playground Link: https://agentcooper.github.io/typescript-play/#code/DYUwLgBAdghgtiAJhAvBA5AMwPbfQbgChRIBvAbVgUQF0AuCABwCdtGBfVCUlthrXOnb4gA

Related Issues:
#23297 (comment)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions