@module on an @instanceOf type is silently ignored
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đá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
- 54/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, ocaml
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start by reading the compiler handling for @module, @scope, and @instanceOf type declarations, then trace the generated JavaScript for the example. Check how @module on an external declaration is represented and tested. Done means the class check either uses the imported or scoped class correctly, or the compiler rejects these attributes on a type declaration.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@module on an @instanceOf type is silently ignored. The class check then reads a global with the class name, instead of importing the class from the module.
@instanceOf("Object3D") type object3D
@module("three") @instanceOf("Mesh") type mesh = private object3D
@unboxed
type shape = Mesh(mesh) | Other(object3D)
let isMesh = (s: shape) =>
switch s {
| Mesh(_) => true
| Other(_) => false
}
compiles without a warning to
function isMesh(s) {
return s instanceof Mesh;
}
There is no import of three. At runtime Mesh is not defined, so the check throws a ReferenceError, unless some other script happens to define a global Mesh.
Expected: either the check uses the imported class, like a @module("three") external would, or @module on a type declaration is a compile error.
@scope("THREE") is ignored the same way: the check is still s instanceof Mesh, not THREE.Mesh.
Raised in https://github.com/rescript-lang/rescript/issues/9058#issuecomment-6658655177. Classes from local files and JS libraries need this, not only the DOM.
- Ngôn ngữ chính
- OCaml
- Star
- 7.5k
- Fork
- 485
- Merge trung bình
- 16 giờ 51 phút
- Pull request đã merge (30 ngày)
- 268
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
-
Exception analysis does not know the Temporal `fromStringOrThrow` functionsCó thể đã có người làm @cknitt đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
rescript-lang/rescript#9182 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Build system: make output wording and labels consistentCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
rescript-lang/rescript#9244 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
rescript format: aborts on a syntax error, unstable output, raw compiler errorsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
rescript-lang/rescript#9243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Build system CLI: behavior that disagrees with the help textCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 43/100
rescript-lang/rescript#9242 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Build system: a failed first build forces full rebuilds, and clean breaks a running watchCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
rescript-lang/rescript#9241 ·
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
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GaloisInc/llvm-pretty#211 ·
-
crash mlir
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
llvm/llvm-project#239604 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue self-hosted compiler
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
AeroForger/AeroFyl#1 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
KhronosGroup/SPIRV-LLVM-Translator#4151 ·
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 78/100
anthropics/claudes-c-compiler#322 ·