Disallow `[method]...` naming unless the resource was defined in the same context
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/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ệ
- wasm
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start with the two component examples in this issue and the linked wasm-tools issue #2731; then locate the wasmparser validation and tests that accept these patterns. The rule for when methods may be attached is unresolved, so done means defining that rule and updating validation and tests without breaking the existing wit-component pattern unintentionally.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Currently wasmparser accepts this component:
(component
(import "a" (instance $a
(export "r" (type (sub resource)))
))
(alias export $a "r" (type $r))
(import "b" (instance
(export "r" (type $x (eq $r)))
(export "[method]r.f" (func (param "self" (borrow $x))))
))
)
But arguably this is a bad idea. This isn't representable in WIT at all and there aren't any actual users of this AFAIK, so I think it would be best to disallow this. In essence only the resource definition should be able to attach methods, because otherwise you could have different instances define the same method and it'd be ambiguous of what to call.
More problematically, however, wasmparser also accepts this:
(component
(type (component
(import "a" (type $a (sub resource)))
(export "r" (type $x (eq $a)))
(export "[method]r.f" (func (param "self" (borrow $x))))
))
)
and this is how wit-component works for any component which exports a resource in an interface. This means that this pattern is widely used meaning that the rule of "must be on the definition" would break a lot of components today.
Ideally wit-component would generate a component that looks like htis:
(component
(type (component
(import "a" (type $a (sub resource)))
(export "r" (type $x (eq $a)) (type (sub resource))) ;; note the type ascription here
(export "[method]r.f" (func (param "self" (borrow $x))))
))
)
but wasmparser does not yet implement that today (https://github.com/bytecodealliance/wasm-tools/issues/2731)
I'm also a bit stuck on what "must be next to the definition" means. For example a resource could be declared, then exported, and then methods must be on the type introduced by the export. In that sense some aliases work, but some don't. Hence, the issue here!
- Ngôn ngữ chính
- WebAssembly
- Star
- 1.4k
- Fork
- 134
- Merge trung bình
- 3 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 WebAssembly/component-model
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
WebAssembly/component-model#609 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
WebAssembly/component-model#769 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
`use` for `implements` interfaceĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
WebAssembly/component-model#768 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
WebAssembly/component-model#753 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
WebAssembly/component-model#752 · 13 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của WebAssembly/component-model
Issue tương tự
-
DAE2 crashes on call.without.effects with a non ref.func expressionCó thể đã có người làm @stevenfontanella đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
WebAssembly/binaryen#9404 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:compiler effort:S impact:med platform:windows type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:Analysis enhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 69/100
facebookresearch/atlas-lean#5118 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
drools: declared enum with 128 or more literals fails at class initialization (NegativeArraySizeException)Có thể đã có người làm @drccrd đã nhận hôm nay. Đang mởarea:rules
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/incubator-kie#7306 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug css P3
Độ 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