Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

L17.P1: uncaught script errors when running this code

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
godot
領域
testing

調査の方向性

Start by reproducing the bug: type cell = cell.y + 1 in the L17.P1 practice and check whether the SCRIPT ERROR lines appear in the output while the test still passes. The error path runs through ui/UIPractice.gd (_test_student_code around line 611, _run_if_valid around line 930) and script_checking/PracticeTester.gd (run_tests around line 72), with the failing test at course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd line 20. Done means a runtime script error during student code makes the practice fail with a visible message, and the test no longer passes.

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

説明

Running the following code raises script errors that are currently not captured by the testing system:

L17.P1 I can type 'cell = cell.y + 1' rather than 'cell += Vector2(0, 1)' and the robot will not move on screen, but the practice will tell me I have succeded and the robot is on the last row.

Technical information:

  • Location: L17.P1 - Introduction to For Loops > Using a for loop to move to the end of the board
  • File: res://course/lesson-18-for-loops/lesson.bbcode
  • Platform: Web
  • Commit: edde160

Code from the current practice

var board_size = Vector2(5, 5)
var cell = Vector2(2, 0)

func move_to_bottom():
    for number in range(board_size.y - 1):
        cell = cell.y + 1

Godot does raise errors in the script, but instead of being caught by the practice system like with almost all other script errors, they go to the output and the code attempts to run; in turn this abort execution of various functions and allows the practice to pass.

SCRIPT ERROR: Invalid access to property or key 'y' on a base object of type 'float'.
          at: move_to_bottom (gdscript://-9223371198983825982.gd:35)
          GDScript backtrace (most recent call first):
              [0] move_to_bottom (gdscript://-9223371198983825982.gd:35)
              [1] _run (gdscript://-9223371198983825982.gd:19)
              [2] _run_if_valid (res://ui/UIPractice.gd:930)
SCRIPT ERROR: Invalid assignment of property or key 'cell' with value of type 'float' on a base object of type 'Node2D (robot_l17_p1.gd)'.
          at: _run (gdscript://-9223371198983825982.gd:20)
          GDScript backtrace (most recent call first):
              [0] _run (gdscript://-9223371198983825982.gd:20)
              [1] _run_if_valid (res://ui/UIPractice.gd:930)
SCRIPT ERROR: Invalid access to property or key 'y' on a base object of type 'float'.
          at: test_robot_gets_to_bottom_of_board (res://course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd:20)
          GDScript backtrace (most recent call first):
              [0] test_robot_gets_to_bottom_of_board (res://course/lesson-18-for-loops/for_move/TestPracticeBoardFor.gd:20)
              [1] run_tests (res://script_checking/PracticeTester.gd:72)
              [2] _test_student_code (res://ui/UIPractice.gd:611)
              [3] _on_autotimer_timeout (res://ui/UIPractice.gd:870)
主要言語
GDScript
スター
2.8k
フォーク
237
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

GDQuest/learn-gdscript のほかの issue

GDQuest/learn-gdscript の issue をすべて見る

似ている issue

Testing & QA の issue をもっと見る

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

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