Skip to content

Commit

Permalink
fix: Array types were converted incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Nov 1, 2020
1 parent 05091b6 commit c892c00
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 83 deletions.
2 changes: 1 addition & 1 deletion src/lib/converter/types.ts
Expand Up @@ -141,7 +141,7 @@ const arrayConverter: TypeConverter<ts.ArrayTypeNode, ts.TypeReference> = {
convertType(context, type) {
const params = context.checker.getTypeArguments(type);
assert(params.length === 1);
return new ArrayType(convertType(context, type));
return new ArrayType(convertType(context, params[0]));
},
};

Expand Down
9 changes: 6 additions & 3 deletions src/test/converter/types/general.ts
@@ -1,7 +1,10 @@
export type BigIntLiteral = 1n;
export type NegativeBigIntLiteral = -1n;

declare function makeValue<T>(): T;

export type BigIntLiteral = 1n;
export const BigIntLiteralType = makeValue<1n>();

export type NegativeBigIntLiteral = -1n;
export const NegativeBigIntLiteralType = makeValue<-1n>();

export type NumArray = number[];
export const numArray = makeValue<number[]>();

0 comments on commit c892c00

Please sign in to comment.