Skip to content
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

Does not catch any type #82

Closed
fregante opened this issue Oct 9, 2020 · 3 comments · Fixed by #113
Closed

Does not catch any type #82

fregante opened this issue Oct 9, 2020 · 3 comments · Fixed by #113

Comments

@fregante
Copy link

fregante commented Oct 9, 2020

Similarly to #78, expectType doesn't seem to catch… any

All of this passes:

import {expectType} from 'tsd';
expectType<false>('' as any);
expectNotType<false>('' as any);
expectNotType<any>('' as any);
{
	"tsd": "^0.13.1",
	"typescript": "^4.0.3"
}
@papb
Copy link
Contributor

papb commented Oct 10, 2020

In the mean time you can use expect-type for this

@SamVerschueren
Copy link
Collaborator

I believe I do a check to see if the generic type isn't declared too wide, for example

expectType<any>(true);
//=> Parameter type `any` is declared too wide for argument type `true`

But I don't think I do it the other way around 🤔 .

@BendingBender
Copy link
Collaborator

@fregante @sindresorhus @papb I've tried to reproduce this issue in the latest version of tsd without success. Can you please confirm that the latest version of tsd is not affected by this?

sindresorhus pushed a commit that referenced this issue Jun 3, 2021
… `expectType`/`expectNotType` (#113)

Closes #78
Closes #82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants