-
-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
expectType doesn't work properly with generic functions. Here's a repro:
import {expectType} from 'tsd'
declare const inferrable: <T = 'SomeDefaultValue'>() => T
expectType<number>(inferrable()) // passes, should failI'm not sure if it's possible to fix given the API design, but here's the same test using expect-type which fails as it should.
import {expectTypeOf} from 'expect-type'
declare const inferrable: <T = 'SomeDefaultValue'>() => T
expectTypeOf(inferrable()).toEqualTypeOf<number>() // fails as expected, because `inferrable()` returns type `'SomeDefaultValue'`papb
Metadata
Metadata
Assignees
Labels
No labels