String index comparison emits char vs string literal: not comparable
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
- 58/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
Hướng nghiên cứu
Start by locating the Dafny backend code that lowers string indexing and emits string literals; the issue does not name those files. Reproduce with the included firstIsA example using lsc check --backend=dafny and inspect the generated Dafny and resolver error. Done when the indexed character comparison resolves successfully and the example verifies.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
String element access lowers to a Dafny char, but a compared string literal stays a string, so any indexed character comparison fails resolution:
//@ backend dafny
export function firstIsA(s: string): boolean {
//@ verify
//@ ensures \result === (s.length > 0 && s[0] === "a")
return s.length > 0 && s[0] === "a";
}
Evidence
- Before:
lsc check --backend=dafnygenerates, then Dafny reportsa.verify.dfy(9,46): Error: arguments must have comparable types (got char and string)for(s[0] == "a"). Exit 1, no workaround that keeps indexing (slicecomparisons are the only way through). - After (expected): the literal is emitted as a Dafny
char('a') or the index access is modeled as a single-character string. Related: #192 (string literal emission in switch cases).
Merge Danger
Door: two-way — generation succeeds, failure surfaces at Dafny resolution, never as a silent wrong proof.
Blast radius: toolchain — any s[i] === "..." comparison in an annotated function.
- 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ự
-
Độ 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
-
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 ·
-
[bug] Second false positive on high-cost plugin alert: detection only compares patch entry id, community plugin dsh-auto | [bug] 高成本插件告警第二次误报:检测只比对 patch 条目 id,社区插件 dsh-auto-review 被认成 @deepseek-ai/dsh-experimental-auto-reviewCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ranxianglei/billion-context#7068 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
vendor: bump whisper.cpp past 6a8addd — the current pin aborts the app on a failed Metal initĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
mybigday/whisper.rn#348 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
six-group/six-webcomponents#600 ·