Skip to content

Commit 28fb12e

Browse files
committed
Maybe fix
1 parent 13ff013 commit 28fb12e

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

packages/typegpu/tests/buffer.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ describe('TgpuBuffer', () => {
716716

717717
// @ts-expect-error: boolean is not allowed in buffer schemas
718718
attest(root.createBuffer(boolSchema)).type.errors.snap(
719-
"No overload matches this call.Overload 1 of 4, '(typeSchema: \"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: Bool; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: Bool; }>' is not assignable to parameter of type '\"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\"'.\nOverload 2 of 4, '(typeSchema: \"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: Bool; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: Bool; }>' is not assignable to parameter of type '\"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\"'",
719+
"No overload matches this call.Overload 1 of 4, '(typeSchema: \"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: Bool; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: Bool; }>' is not assignable to parameter of type '\"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\"'.\nOverload 2 of 4, '(typeSchema: \"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: Bool; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: Bool; }>' is not assignable to parameter of type '\"(Error) in struct property 'b' — Bool is not host-shareable, use U32 or I32 instead\"'.",
720720
);
721721

722722
const nestedBoolSchema = d.struct({
@@ -731,7 +731,8 @@ describe('TgpuBuffer', () => {
731731

732732
// @ts-expect-error: boolean is not allowed in buffer schemas
733733
attest(root.createBuffer(nestedBoolSchema)).type.errors.snap(
734-
"No overload matches this call.Overload 1 of 4, '(typeSchema: \"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U16; b: U32; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U16; b: U32; }>' is not assignable to parameter of type '\"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\"'.\nOverload 2 of 4, '(typeSchema: \"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U16; b: U32; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U16; b: U32; }>' is not assignable to parameter of type '\"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\"'",
734+
`No overload matches this call.Overload 1 of 4, '(typeSchema: "(Error) in struct property 'b' — in struct property 'd' — in struct property 'e' — Bool is not host-shareable, use U32 or I32 instead", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: WgslStruct<...>; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: WgslStruct<{ c: F32; d: WgslStruct<{ e: Bool; }>; }>; }>' is not assignable to parameter of type '"(Error) in struct property 'b' — in struct property 'd' — in struct property 'e' — Bool is not host-shareable, use U32 or I32 instead"'.
735+
Overload 2 of 4, '(typeSchema: "(Error) in struct property 'b' — in struct property 'd' — in struct property 'e' — Bool is not host-shareable, use U32 or I32 instead", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: WgslStruct<...>; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: WgslStruct<{ c: F32; d: WgslStruct<{ e: Bool; }>; }>; }>' is not assignable to parameter of type '"(Error) in struct property 'b' — in struct property 'd' — in struct property 'e' — Bool is not host-shareable, use U32 or I32 instead"'.`,
735736
);
736737
});
737738

@@ -748,7 +749,8 @@ describe('TgpuBuffer', () => {
748749

749750
// @ts-expect-error
750751
attest(root.createBuffer(notFine)).type.errors.snap(
751-
"No overload matches this call.Overload 1 of 4, '(typeSchema: \"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U16; b: U32; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U16; b: U32; }>' is not assignable to parameter of type '\"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\"'.\nOverload 2 of 4, '(typeSchema: \"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U16; b: U32; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U16; b: U32; }>' is not assignable to parameter of type '\"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\"'",
752+
`No overload matches this call.Overload 1 of 4, '(typeSchema: "(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead", initial?: InferInput<NoInfer<WgslStruct<{ a: U16; b: U32; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U16; b: U32; }>' is not assignable to parameter of type '"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead"'.
753+
Overload 2 of 4, '(typeSchema: "(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead", initial?: InferInput<NoInfer<WgslStruct<{ a: U16; b: U32; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U16; b: U32; }>' is not assignable to parameter of type '"(Error) in struct property 'a' — U16 is only usable inside arrays for index buffers, use U32 or I32 instead"'.`,
752754
);
753755

754756
const alsoNotFine = d.struct({
@@ -759,7 +761,8 @@ describe('TgpuBuffer', () => {
759761

760762
// @ts-expect-error
761763
attest(root.createBuffer(alsoNotFine)).type.errors.snap(
762-
"No overload matches this call.Overload 1 of 4, '(typeSchema: \"(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: WgslArray<...>; c: F32; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: WgslArray<U16>; c: F32; }>' is not assignable to parameter of type '\"(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\"'.\nOverload 2 of 4, '(typeSchema: \"(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: WgslArray<...>; c: F32; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: WgslArray<U16>; c: F32; }>' is not assignable to parameter of type '\"(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead\"'",
764+
`No overload matches this call.Overload 1 of 4, '(typeSchema: "(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: WgslArray<...>; c: F32; }>>> | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: WgslArray<U16>; c: F32; }>' is not assignable to parameter of type '"(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead"'.
765+
Overload 2 of 4, '(typeSchema: "(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead", initial?: InferInput<NoInfer<WgslStruct<{ a: U32; b: WgslArray<...>; c: F32; }>>> | ((buffer: TgpuBuffer<...>) => void) | undefined): TgpuBuffer<...>', gave the following error.Argument of type 'WgslStruct<{ a: U32; b: WgslArray<U16>; c: F32; }>' is not assignable to parameter of type '"(Error) in struct property 'b' — in array element — U16 is only usable inside arrays for index buffers, use U32 or I32 instead"'.`,
763766
);
764767
});
765768

0 commit comments

Comments
 (0)