Skip to content

Commit 67b4972

Browse files
committed
Add support for never param types as wildcard, Closes #85
1 parent ecd24ee commit 67b4972

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/parse/ParameterLoader.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ export class ParameterLoader {
403403
case AST_NODE_TYPES.TSFunctionType:
404404
case AST_NODE_TYPES.TSImportType:
405405
case AST_NODE_TYPES.TSMappedType:
406+
case AST_NODE_TYPES.TSNeverKeyword:
406407
// TODO: These types are explicitly not supported at the moment
407408
return { type: 'wildcard' };
408409
case AST_NODE_TYPES.TSTupleType:

test/parse/ParameterLoader.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,8 @@ export interface A{
18261826
it('should get the range of unsupported types as wildcard', async() => {
18271827
expect(await getFieldRange('fieldA: () => void', {}))
18281828
.toEqual({ type: 'wildcard' });
1829+
expect(await getFieldRange('fieldA: never', {}))
1830+
.toEqual({ type: 'wildcard' });
18291831
});
18301832

18311833
it('should get the range of a union type of two raw types', async() => {

0 commit comments

Comments
 (0)