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

A false positive case on generics #56

Closed
Jack-Works opened this issue Jun 28, 2020 · 4 comments
Closed

A false positive case on generics #56

Jack-Works opened this issue Jun 28, 2020 · 4 comments
Labels
bug Something isn't working fixed and released

Comments

@Jack-Works
Copy link

Version(if relevant): 2.8.2

Code(if relevant):

function x(y: Map<string, number>) {}

x(new Map())
// in strict mode, the implicit Map<any, any>
// is considered not covered
// but it's actually type-safe.
@plantain-00
Copy link
Owner

I cannot reproduce it using your code.

@plantain-00 plantain-00 added the question Further information is requested label Jun 28, 2020
@Jack-Works
Copy link
Author

Hmm sorry, maybe I'm over abstracted my case so it isn't work anymore. I'll try to verify it later

@Jack-Works
Copy link
Author

type conf = {
    a: Map<string, number>
}
function f(t: conf) {}
f({ a: new Map() })

This is my case.

➜ yarn type-coverage --strict --detail
test.ts:6:5: a
8 / 9 88.88%
type-coverage success.

a should not be uncovered.

@plantain-00 plantain-00 added bug Something isn't working and removed question Further information is requested labels Jun 28, 2020
@plantain-00
Copy link
Owner

v2.8.3 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed and released
Projects
None yet
Development

No branches or pull requests

2 participants