From 576caf666a1cfc65bbcbd2c670f29eaef059e04f Mon Sep 17 00:00:00 2001 From: Kyle Scott Date: Thu, 30 Nov 2023 22:57:42 -0500 Subject: [PATCH] fix bug --- src/keccakf.test-d.ts | 53 +++++++++++++++++++++++++++++++++++++++++++ src/keccakf.ts | 8 +++---- 2 files changed, 57 insertions(+), 4 deletions(-) diff --git a/src/keccakf.test-d.ts b/src/keccakf.test-d.ts index bac46ed..28f2196 100644 --- a/src/keccakf.test-d.ts +++ b/src/keccakf.test-d.ts @@ -51,7 +51,60 @@ test("_KeccakF", () => { // ^? assertType>([] as unknown as t); + assertType([] as unknown as Word1); + assertType([] as unknown as Word1); + assertType([] as unknown as Word0); assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); + assertType([] as unknown as Call); + assertType([] as unknown as Word0); }); test("KeccakF", () => { diff --git a/src/keccakf.ts b/src/keccakf.ts index 90ebb96..4198361 100644 --- a/src/keccakf.ts +++ b/src/keccakf.ts @@ -215,7 +215,7 @@ export interface RhoAndPi extends Fn { Call, Call, Call, - Call, + Call, Call, Call, Call, @@ -397,9 +397,9 @@ export interface Iota extends Fn { */ export interface _KeccakF extends Fn { return: this["args"] extends [infer s extends S, infer round extends Round[number]] - ? Call extends infer a extends S - ? Call extends infer b extends S - ? Call extends infer c extends S + ? Call extends infer a + ? Call extends infer b + ? Call extends infer c ? Call : never : never