Skip to content

bug: type predicates (V is T) fails on expressions (V[K] is T) #12549

@KiaraGrouwstra

Description

@KiaraGrouwstra

TypeScript Version: nightly (2.2.0-dev.20161128)

Code

propIs<T, V, K extends keyof V>(type: T, name: K, obj: V): V[K] is T;

Expected behavior:
TS being totally cool with V[K] is T.

Actual behavior:
Nope, many syntax errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions