Printed type declarations drop @tag, @notUndefined and runtime annotations
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ocaml
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start with Printtyp.tree_of_type_decl, which the issue identifies as the printer used by error messages, hover, and createInterface. Compare its handling of @unboxed and @immediate with @tag, @notUndefined, @typeOf, and @instanceOf; use the named expected-output files and the applied-functor example to check the affected paths. Done means printed declarations retain these annotations in diagnostics, hover, and generated interfaces. An open linked pull request already tracks the work.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Printed type declarations keep @unboxed and @immediate, but drop the other annotations of a declaration: @tag, @notUndefined and the runtime annotations (@typeOf, @instanceOf). @as on fields and constructors is kept. The printer is Printtyp.tree_of_type_decl, used by error messages, hover and createInterface.
Error messages. The declaration the message is about is printed without the annotation it names:
module M: {
@tag("kind") type v = Circle({r: float}) | Square({side: float})
} = {
@tag("type") type v = Circle({r: float}) | Square({side: float})
}
Type declarations do not match:
type v = Circle({r: float}) | Square({side: float})
is not included in
type v = Circle({r: float}) | Square({side: float})
...
Their @tag annotations differ.
The same happens with @notUndefined (tests/build_tests/super_errors/expected/not_undefined_functor_argument.res.expected, where the expected side prints as type t) and with @typeOf (runtime_annotation_interface_over_record.res.expected).
Generated interfaces. createInterface prints a type when it cannot copy its source, as for a type of an applied functor. The annotation is lost and the interface does not match its implementation:
module Make = (X: {type t}) => {
@tag("kind") type wrapped = Value({value: X.t}) | Empty({reason: string})
}
module Applied = Make({
type t = int
})
The generated interface has module Applied: { type wrapped = Value({value: int}) | Empty({reason: string}) }, and compiling it with the implementation fails:
In module Applied:
Type declarations do not match:
type wrapped = Applied.wrapped = Value({value: int}) | Empty({reason: string})
is not included in
type wrapped = Value({value: int}) | Empty({reason: string})
...
Their @tag annotations differ.
Hover prints types the same way, so it hides these annotations too.
- Ngôn ngữ chính
- OCaml
- Star
- 7.5k
- Fork
- 484
- Merge trung bình
- 21 giờ 9 phút
- Pull request đã merge (30 ngày)
- 255
Chuẩn bị môi trường
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.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rescript-lang/rescript
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
rescript-lang/rescript#9135 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
rescript-lang/rescript#9132 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rescript-lang/rescript#9130 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
rescript-lang/rescript#9122 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dev dependencies interactingCó thể đã có người làm @CarlOlson đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 25/100
rescript-lang/rescript#9089 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rescript-lang/rescript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CanadaHonk/porffor#426 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
compiler-rt:asan llvm:transforms
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
llvm/llvm-project#236682 ·
Maintainer thường phản hồi trong vòng 1 ngày