TypedDictionary doesn't support Vector4(i)

Open Beginner friendly
#1,967 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp, godot
Domain
game-dev, tooling

Research direction

Start in include/godot_cpp/variant/typed_dictionary.hpp and reproduce the issue with TypedDictionary<StringName, Vector4i>. Compare the typed-dictionary macro expansions with the Vector4 and Vector4i variant definitions. Done when both vector types instantiate without the reported compiler errors and the project builds successfully.

Written by the indexing model from the issue text.

Description

Godot version

4.6.1-stable

godot-cpp version

41cfbd1

System information

Likely irrelevant: Windows 11 25H2 (26200.8117), Intel i7-11700F, 64GB RAM, NVIDIA RTX 3060 Ti

Issue description

TypedDictionary does not support using Vector4 and Vector4i:

<path>\godot-cpp\include\godot_cpp/variant/typed_dictionary.hpp(243): error C2039: 'get_class_static': is not a member of 'godot::Vector4i'
<path>\godot-cpp\include\godot_cpp/variant/vector4i.hpp(41): note: see declaration of 'godot::Vector4i'
<path>\godot-cpp\include\godot_cpp/variant/typed_dictionary.hpp(243): note: the template instantiation context (the oldest one first) is
src\resources\anim_cfg_resource.cpp(179): note: see reference to class template instantiation 'godot::TypedDictionary<godot::StringName,godot::Vector4i>' being compiled
<path>\godot-cpp\include\godot_cpp/variant/typed_dictionary.hpp(243): note: while compiling class template member function 'godot::TypedDictionary<godot::StringName,godot::Vector4i>::TypedDictionary(void)'
src\resources\anim_cfg_resource.cpp(196): note: see the first reference to 'godot::TypedDictionary<godot::StringName,godot::Vector4i>::TypedDictionary' in 'godot::AnimConfigResource::get_animation_configs_dict'
<path>\godot-cpp\include\godot_cpp/variant/typed_dictionary.hpp(243): error C3861: 'get_class_static': identifier not found
scons: *** [src\resources\anim_cfg_resource.windows.template_debug.x86_64.obj] Error 2
scons: building terminated because of errors.

Without digging too deep in the code, it seems to stem from typed_dictionary.hpp not including things like:

MAKE_TYPED_DICTIONARY_EXPANDED(m_type, m_variant_type, Vector4, Variant::VECTOR4)
MAKE_TYPED_DICTIONARY_EXPANDED(m_type, m_variant_type, Vector4i, Variant::VECTOR4I)

and

MAKE_TYPED_DICTIONARY(Vector4, Variant::VECTOR4)
MAKE_TYPED_DICTIONARY(Vector4i, Variant::VECTOR4I)
Steps to reproduce
TypedDictionary<StringName, Vector4i>
Minimal reproduction project

This felt unnecessary, I'll happily provided upon request.

Dominant language
C++
Stars
2.7k
Forks
810
Avg merge
1d 3h
Merged PRs (30d)
8

Contributor guide

No contributing guide indexed for this repository

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.

More from godotengine/godot-cpp

All issues in godotengine/godot-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.