@notUndefined in an interface is not checked against the implementation
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #8966 của @cknitt — đã merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/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 compiler/ml/UntaggedVariants.md, rule 13, and the linked discussion in #8952, which describe the current interface inclusion behavior. Then trace inclusion checks for @notUndefined across interfaces, functor arguments, and with type constraints. Done means implementations whose types can hold undefined are rejected while the listed valid implementation types remain accepted; linked pull request #8966 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
An interface can declare an abstract type @notUndefined while its implementation is a type that holds undefined. Interface inclusion does not compare the attribute, so clients unbox option of the type, and Some(None) becomes None.
// M.resi
@notUndefined type t
let none: t
// M.res
type t = option<int>
let none: t = None
// C.res
@inline(never) let id = x => x
let o: option<M.t> = id(Some(M.none))
Console.log2(
"Some(none) is",
switch o {
| Some(_) => "Some"
| None => "None"
},
)
Output on master: Some(none) is None. C builds Some(M.none) as M.none itself, which is undefined.
Expected: the implementation is rejected, because type t = option<int> can hold undefined, which the interface rules out. An implementation satisfies @notUndefined when its own type cannot hold undefined: it is @notUndefined itself, a record, a builtin type other than option/unit, or a type declared with @instanceOf/@typeOf (#8950).
The same holds for functor arguments and with type constraints. compiler/ml/UntaggedVariants.md (rule 13, #8952) states that inclusion does not compare @notUndefined.
- Ngôn ngữ chính
- OCaml
- Star
- 7.5k
- Fork
- 483
- Merge trung bình
- 20 giờ 7 phút
- Pull request đã merge (30 ngày)
- 227
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ó 4/5 3-5 ngày Mức phù hợp với người mới 57/100
rescript-lang/rescript#9063 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Formatter moves a line comment in a switch/if/loop operand into the blockCó thể đã có người làm @cknitt đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rescript-lang/rescript#9060 ·
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 25/100
rescript-lang/rescript#9058 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RFC: Temporal API bindingsĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
rescript-lang/rescript#9044 · 1 bình luận · 3 reaction ·
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#9006 · 1 bình luận · 1 reaction ·
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ự
-
bug intrinsic medium priority rt_lib
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:codegen backend:metal bug direction:output
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
JS_SetPropertyInternal2 loses the value when a lazy property on the prototype runs out of memoryĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quickjs-ng/quickjs#1852 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
matter-labs/era-compiler-llvm#978 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
manuscript-lang/manuscript#1604 ·
Maintainer thường phản hồi trong vòng 1 ngày