String index comparison emits char vs string literal: not comparable
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 58/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 113
- フォーク
- 13
- 平均マージ
- 16時間 22分
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
midspiral/LemmaScript のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
midspiral/LemmaScript#308 ·
メンテナーはふだん 1 日以内に返信
-
Dafny: `toUpperCase`/`toLowerCase` are modeled as ASCII-only, so false contracts about non-ASCII text verify対応中かも @quangng2000 が 1 日前に担当しました。 オープン
midspiral/LemmaScript#312 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 56/100
midspiral/LemmaScript#311 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 48/100
midspiral/LemmaScript#310 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
midspiral/LemmaScript#309 ·
メンテナーはふだん 1 日以内に返信
midspiral/LemmaScript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
vercel-labs/ui#809 ·
メンテナーはふだん 1 日以内に返信
-
bot:ai-assisted component:platform-js status:untriaged
難易度 1/5 1時間未満 初心者へのやさしさ 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-review対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ranxianglei/billion-context#7068 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
mybigday/whisper.rn#348 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
six-group/six-webcomponents#600 ·