Cross-file as const array import resolves as unknown
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/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ệ
- typescript
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start by tracing how imported declarations from a.ts are resolved and how readonly tuples are converted for Dafny emission; inspect the tuple homogeneity rule and the diagnostic for unsupported .includes() calls. Reproduce with the issue’s a.ts and b.verify.ts example using lsc check --backend=dafny. Done means the readonly tuple resolves to seq<string> and emits successfully, or the tool reports a clear diagnostic that as const is unsupported.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
A cross-file as const array import loses its element type and arrives as unknown, so every method call on it fails emission:
a.ts:
export const methods = ["get", "post", "put"] as const;
b.verify.ts:
//@ backend dafny
import { methods } from "./a.js";
export function isKnown(m: string): boolean {
//@ verify
return methods.includes(m);
}
Evidence
- Before:
lsc check --backend=dafnyfails withERROR: Dafny emission failed for 'isKnown' in b.verify.ts: Unsupported Dafny method call: .includes() on unknown. Exit 1. - After (expected): the readonly tuple resolves to
seq<string>like a plain array literal does (see the tuple homogeneity rule), or a clear diagnostic namesas constas unsupported.
Merge Danger
Door: two-way — emission failure, fails loud.
Blast radius: toolchain — shared constant tables (as const is the idiomatic way to define them) are unusable across files.
- Ngôn ngữ chính
- TypeScript
- Star
- 113
- Fork
- 13
- Merge trung bình
- 16 giờ 22 phút
- Pull request đã merge (30 ngày)
- 40
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 midspiral/LemmaScript
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
midspiral/LemmaScript#308 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dafny: `toUpperCase`/`toLowerCase` are modeled as ASCII-only, so false contracts about non-ASCII text verifyCó thể đã có người làm @quangng2000 đã nhận 1 ngày trước. Đang mở
midspiral/LemmaScript#312 · 1 bình luận · 1 người được giao ·
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 56/100
midspiral/LemmaScript#311 ·
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 48/100
midspiral/LemmaScript#310 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
midspiral/LemmaScript#309 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của midspiral/LemmaScript
Issue tương tự
-
area: batch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
inabagumi/shinju-date#7294 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
streaming-video-technology-alliance/common-media-library#700 ·
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 82/100
vercel-labs/ui#809 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
KrisCris/village-in-the-shade-guide#75 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot:ai-assisted component:platform-js status:untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
midnightntwrk/platform-js#38 ·