Skip to content

fix: Make numeric names valid #2592

@aleksanderkatan

Description

@aleksanderkatan

This may actually happen when using externals, since we name unnamed items based on the external key.

    const myBuf = root.createMutable(d.u32).$name('0');
    const fn = () => {
      'use gpu';
      myBuf.$ = 2;
    };

    expect(tgpu.resolve([fn])).toMatchInlineSnapshot(`
      "@group(0) @binding(0) var<storage, read_write> 0: u32;

      fn fn_1() {
        0 = 2u;
      }"
    `);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions