buf_from_list of a non-list answers null in every state of EIGS_STRICT

オープン
#2,467 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
backend

調査の方向性

Start with the buf_from_list builtin implementation and the strict type guard pattern used by similar builtins; then read tools/strict_differential.sh, tests/strict_guard_release_messages.tsv, and the buf_* constructor probes. Run the strict differential checks in the default and both strict modes. Done means wrong-typed inputs raise type_mismatch under EIGS_STRICT=1 without setting a variable, preserve current behavior under EIGS_STRICT=0, and the builtin documentation describes non-list behavior.

索引モデルが issue の本文から書いたものです。

説明

area:stdlib kind:silent-wrong

buf_from_list given something that is not a list answers null, in every state of EIGS_STRICT, where a wrong-typed argument of a builtin raises by default (#2439):

$ cat p.eigs
try:
    x is buf_from_list of 1
    print of [x, type of x]
catch e:
    print of [e.kind, e.message]
try:
    y is buf_from_list of "a"
    print of [y, type of y]
catch e:
    print of [e.kind, e.message]
$ eigenscript p.eigs                 # phase2-numbers at f9f3e49b; the same with EIGS_STRICT=0 and EIGS_STRICT=1
[null, "null"]
[null, "null"]

The last release (v0.48.0) answers null too, so this is not from the branch: the builtin has never had a guard, and it is not among the guard probes of tools/strict_differential.sh (no row for it in tests/strict_guard_release_messages.tsv).

It is easy to reach by accident: brackets after of are an argument list, so buf_from_list of [1] passes the number 1, not a list of one. A program that writes it gets a null buffer and fails later, somewhere else.

Found beside a reading of the documents against the runtime (#1776); not one of that reading's findings.

Done when

  • buf_from_list of a value that is not a list (a number, a string, null, a dict) raises type_mismatch with no variable set and under EIGS_STRICT=1, with a message that names the builtin; under EIGS_STRICT=0 it keeps today's answer.
  • The builtin has a guard probe in tools/strict_differential.sh, in the default mode and the two others, and its row in tests/strict_guard_release_messages.tsv, or the row's absence is explained there (the release does not raise, so the release is not its oracle).
  • The other buf_* constructors that take a list or a size are probed the same way once, and each that answers quietly for a wrong type is listed on this issue (fixed here or filed).
  • docs/BUILTINS.md's row for buf_from_list says what a non-list gives.

— Claude DevBox

主要言語
C
スター
3
フォーク
7
平均マージ
3時間 28分
マージ済み PR(30日)
270

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

InauguralSystems/EigenScript のほかの issue

InauguralSystems/EigenScript の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。