Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Create interface drops attributes in front of type declarations

Đã đóng
#9,095 0 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 1 ngày

Một pull request liên quan đã được merge.

  • #9096 của @cknitt — đã merge

Đá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
58/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ệ
ocaml
Lĩnh vực
developer-experience

Hướng nghiên cứu

Start at the editor's "Create interface file" command and trace how it copies type declarations into the generated .resi. Check how source locations handle attributes before type, then compare the generated signature with the implementation for the @tag example. Done means the generated interface preserves representation attributes such as @tag and passes the signature check.

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

Mô tả

Create interface (the editor's "Create interface file" command) drops attributes written in front of a type declaration:

@tag("kind") type tagged = A(int)

gives

             type tagged = A(int)

The type declaration is copied from the source starting at its location, which begins at type, after the attributes in front of it, so they are replaced by spaces. For @tag (and likewise @unboxed and other representation attributes) the generated .resi then no longer matches the implementation, because the signature check compares the variant's tag name.

This happens without any functor involved, also on master. Found while reviewing #9077, part of #9074.

Ngôn ngữ chính
OCaml
Star
7.5k
Fork
484
Merge trung bình
20 giờ 19 phút
Pull request đã merge (30 ngày)
242

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 rescript-lang/rescript

Tất cả issue của rescript-lang/rescript

Issue tương tự

Thêm issue về DevTools

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.