Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
GD0402: 클래스는 일반 클래스가 아니어야 합니다.
규칙 ID |
GD0402 |
카테고리 |
사용례 |
수정 내용이 중단되거나 중단되지 않음 |
굽기 |
기본적으로 활성화됨 |
es |
원인
일반 유형에는 [GlobalClass] 속성으로 주석이 추가됩니다.
설명
Godot 편집기는 모든 :ref:`global class <doc_c_sharp_global_classes>`가 인스턴스화 가능하다고 가정하지만 유형 매개변수가 바인딩되지 않기 때문에 일반 유형은 인스턴스화할 수 없습니다.
// This type is a valid global class because it's not generic.
[GlobalClass]
class SomeType : Node { }
// This type is not a valid global class because it's generic.
[GlobalClass]
class SomeGenericType<T> { }
독립적으로 존재해야 하는 것
이 규칙 위반을 해결하려면 유형을 변경하여 일반 유형 매개변수를 제거하거나 [GlobalClass] 속성을 제거하십시오.
경고를 억제해야 하는 경우
이 규칙에서 경고를 표시하지 마세요. ``[GlobalClass]``를 일반 유형에 추가하는 것은 저지르기 쉬운 실수이며 이 경고는 사용자가 예상치 못한 오류가 발생할 수 있음을 인식하는 데 도움이 됩니다.