From dc5e615a1ded63d34d000a5ef3386de613b99e1c Mon Sep 17 00:00:00 2001 From: Lukas Tenbrink Date: Sat, 4 Oct 2025 11:02:44 +0200 Subject: [PATCH] Remove `Array` include from `dictionary.h` and `ustring.h`. --- core/extension/gdextension_special_compat_hashes.h | 2 ++ core/string/node_path.h | 2 ++ core/string/ustring.cpp | 1 + core/string/ustring.h | 1 - core/variant/callable.h | 1 + core/variant/dictionary.cpp | 2 ++ core/variant/dictionary.h | 5 ++--- 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/extension/gdextension_special_compat_hashes.h b/core/extension/gdextension_special_compat_hashes.h index 2f3cd146ae3..e3ac9d6b65f 100644 --- a/core/extension/gdextension_special_compat_hashes.h +++ b/core/extension/gdextension_special_compat_hashes.h @@ -36,6 +36,8 @@ #include "core/templates/hash_map.h" #include "core/templates/local_vector.h" +class Array; + // Note: In most situations, compatibility methods should be registered via ClassDB::bind_compatibility_method(). // This class is only meant to be used in exceptional circumstances, for example, when Godot's hashing // algorithm changes and registering compatibility methods for all affect methods would be onerous. diff --git a/core/string/node_path.h b/core/string/node_path.h index a94df84a9d7..9ba10d4451c 100644 --- a/core/string/node_path.h +++ b/core/string/node_path.h @@ -33,6 +33,8 @@ #include "core/string/string_name.h" #include "core/string/ustring.h" +#include + class [[nodiscard]] NodePath { struct Data { SafeRefCount refcount; diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 9a1de524d54..2a7de9c0540 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -31,6 +31,7 @@ #include "ustring.h" STATIC_ASSERT_INCOMPLETE_TYPE(class, Dictionary); +STATIC_ASSERT_INCOMPLETE_TYPE(class, Array); #include "core/crypto/crypto_core.h" #include "core/math/color.h" diff --git a/core/string/ustring.h b/core/string/ustring.h index c4c6bdf1b63..8dbf593654f 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -37,7 +37,6 @@ #include "core/templates/hashfuncs.h" #include "core/templates/vector.h" #include "core/typedefs.h" -#include "core/variant/array.h" class String; template diff --git a/core/variant/callable.h b/core/variant/callable.h index 3c6919e4e12..fda5dc3a776 100644 --- a/core/variant/callable.h +++ b/core/variant/callable.h @@ -33,6 +33,7 @@ #include "core/object/object_id.h" #include "core/string/string_name.h" +class Array; class Object; class Variant; class CallableCustom; diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp index ea110477f2a..104b9da6491 100644 --- a/core/variant/dictionary.cpp +++ b/core/variant/dictionary.cpp @@ -30,6 +30,8 @@ #include "dictionary.h" +STATIC_ASSERT_INCOMPLETE_TYPE(class, Array); + #include "core/templates/hash_map.h" #include "core/templates/safe_refcount.h" #include "core/variant/container_type_validate.h" diff --git a/core/variant/dictionary.h b/core/variant/dictionary.h index 5558c4e2089..34c870a8e54 100644 --- a/core/variant/dictionary.h +++ b/core/variant/dictionary.h @@ -30,15 +30,14 @@ #pragma once -#include "core/string/ustring.h" #include "core/templates/hash_map.h" #include "core/templates/local_vector.h" #include "core/templates/pair.h" -#include "core/variant/array.h" #include "core/variant/variant_deep_duplicate.h" +class Array; +class StringName; class Variant; - struct ContainerType; struct ContainerTypeValidate; struct DictionaryPrivate;