fix: Check assignment type during resolution

Đang mở
#3,208 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Start by locating the resolver logic exercised by tgpu.resolve and the tests around assignment typing; the issue does not name a file or test path. Reproduce the shown case where a number | d.v2f variable accepts a d.u32 initializer and then a d.vec2f() assignment. Done when resolution rejects assignments whose type is incompatible with the variable’s declared type and the regression is covered by a test.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Currently this is allowed, and it shouldn't be:

it('...', () => {
  const fn = tgpu.fn([d.vec4f])((v) => {
    'use gpu';
    let t: number | d.v2f = d.u32(1);
    t = d.vec2f();
  });

  expect(tgpu.resolve([fn])).toMatchInlineSnapshot(`
    "fn fn_1(v: vec4f) {
      var t = 1u;
      t = vec2f();
    }"
  `);
});
Ngôn ngữ chính
TypeScript
Star
3.3k
Fork
143
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của software-mansion/TypeGPU

Tất cả issue của software-mansion/TypeGPU

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.