Skip to content

Add more never special cases #24291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ericanderson opened this issue May 21, 2018 · 3 comments
Closed

Add more never special cases #24291

ericanderson opened this issue May 21, 2018 · 3 comments
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@ericanderson
Copy link
Contributor

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
@ericanderson
Copy link
Contributor Author

Given #22964

@jack-williams
Copy link
Collaborator

If you were to add these cases would never stop being bottom and start becoming some ad-hoc type?

@mhegazy mhegazy added the Suggestion An idea for TypeScript label May 21, 2018
@weswigham weswigham added Working as Intended The behavior described is the intended behavior; this is not a bug and removed Suggestion An idea for TypeScript labels Nov 6, 2018
@typescript-bot
Copy link
Collaborator

This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

5 participants