Skip to content

Add more never special cases #24291

Closed
Closed
@ericanderson

Description

@ericanderson

Given that we are special casing never now, could we consider handling this too:

declare const nope: never;

declare const anArray: any[];
declare const anObject: { [key: string]: any };
declare function aMethod(arg: string): string;

anArray[nope]; // $ExpectError
anObject[nope]; // $ExpectError
aMethod(nope); // $ExpectError

const hello = "hello " + nope; // $ExpectError
const meaningOfLife = 42 + nope; // $ExpectError

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions