diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index 4ce37925f2..07877315f1 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1349,9 +1349,9 @@ declare abstract class i31 { /** Macro type evaluating to the underlying native WebAssembly type. */ declare type native = T; /** Special type evaluating the indexed access index type. */ -declare type indexof = keyof T; +declare type indexof> = keyof T; /** Special type evaluating the indexed access value type. */ -declare type valueof = T[0]; +declare type valueof> = T[0]; /** A special type evaluated to the return type of T if T is a callable function. */ declare type ReturnType any> = T extends (...args: any) => infer R ? R : any; /** A special type evaluated to the return type of T if T is a callable function. */ diff --git a/tests/compiler/indexof-valueof.debug.wat b/tests/compiler/indexof-valueof.debug.wat index 769d965c90..533013ceaf 100644 --- a/tests/compiler/indexof-valueof.debug.wat +++ b/tests/compiler/indexof-valueof.debug.wat @@ -73,6 +73,23 @@ drop i32.const 1 drop + i32.const 0 + i32.eqz + drop + i32.const 4 + i32.const 4 + i32.eq + drop + i32.const 1 + drop + i32.const 1 + drop + i32.const 8 + i32.const 8 + i32.eq + drop + i32.const 1 + drop i32.const 1 drop i32.const 1 diff --git a/tests/compiler/indexof-valueof.ts b/tests/compiler/indexof-valueof.ts index 9e271e2c0b..44bc5cc950 100644 --- a/tests/compiler/indexof-valueof.ts +++ b/tests/compiler/indexof-valueof.ts @@ -39,6 +39,12 @@ assert(sizeof>() == 4); // i32 assert(isInteger>()); assert(!isSigned>()); assert(sizeof>() == 1); +assert(isFloat>()); +assert(!isInteger>()); +assert(sizeof>() == 4); +assert(isInteger>()); +assert(isSigned>()); +assert(sizeof>() == 8); // map indexes assert(isInteger>>());