Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

GDScript 경고 시스템(Warning system)

경고 시스템은 정적 타이핑 GDScript을 보완해줍니다(정적 타이핑 없이도 동작할 수 있습니다). 개발 중에 발견하기 어렵고 실행 시간 오류로 이어질 수 있는 실수를 방지하는 데 도움이 됩니다.

You can configure warnings in the Project Settings under the section called GDScript:

../../../_images/typed_gdscript_warning_system_settings.webp

참고

You must enable Advanced Settings in order to see the GDScript section in the sidebar. You can also search for "GDScript" when Advanced Settings is off.

You can find a list of warnings for the active GDScript file in the script editor's status bar. The example below has 2 warnings:

../../../_images/typed_gdscript_warning_example.webp

To ignore specific warnings in one file, insert an annotation of the form @warning_ignore("warning-id"), or click on the ignore link to the left of the warning's description. Godot will add an annotation above the corresponding line and the code won't trigger the corresponding warning anymore:

../../../_images/typed_gdscript_warning_system_ignore.webp

Warnings won't prevent the game from running, but you can turn them into errors if you'd like. This way your game won't compile unless you fix all warnings. Head to the GDScript section of the Project Settings to turn on this option to the warning that you want. Here's the same file as the previous example with the warning unused_variable as an error turned on:

../../../_images/typed_gdscript_warning_system_errors.webp