Skip to content

TypeScript 2 beta: undefined lookup on object gives error #9684

@OliverJAsh

Description

@OliverJAsh

Given:

window[undefined]

I get:

main.ts(21,1): error TS2342: An index expression argument must be of type 'string', 'number', 'symbol', or 'any'.

I don't understand what is wrong about the expression y[undefined]?

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