lean-ja / lean-ja/lean-by-example

暗黙の型変換(型強制)がバグの温床にならない条件とはなにか?

Open
#2,524 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Zulipで質問すべき
Dominant language
Lean
Stars
188
Forks
15
Avg merge
9h 8m
Merged PRs (30d)
6

Description

なんとなく「型変換が単射であれば良いのかな?」と思っていたが、違うことに気づいた。

JavaScript においては数値を文字列に変換する変換がある。たとえば 1 を "1" にするなど。この変換は単射だが、しかしわかりづらくバグの温床であるとして問題になっている。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by reading the question and its JavaScript number-to-string example, then identify where this project discusses implicit conversion or type coercion. Done means documenting clear conditions for safe coercion and addressing whether injectivity is sufficient.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.