-
-
Notifications
You must be signed in to change notification settings - Fork 688
Closed
Labels
breaks compatdiscussionenhancementThis is an enhancement on the current functionalityThis is an enhancement on the current functionality
Description
Godot version
4.2
godot-cpp version
4.2-stable
System information
macOS (but it's irrelevant)
Issue description
In the test code:
String Example::test_string_resize(String p_string) const {
int orig_len = p_string.length();
p_string.resize(orig_len + 3);
...String::length() returns an int64_t, but String::resize() only takes an int:
Error resize(int p_size);When dealing with string sizes, the type should be consistent throughout the class. In fact I would recommend creating a type for it so it's obvious when we're dealing with lengths. Something like:
using StringLen = int64_t;
StringLen length() const;
Error resize(StringLen p_size);Steps to reproduce
(It's an API bug.)
Minimal reproduction project
(It's in the test code: test/src/example.cpp - Example::test_string_resize)
ChubercikAThousandShips
Metadata
Metadata
Assignees
Labels
breaks compatdiscussionenhancementThis is an enhancement on the current functionalityThis is an enhancement on the current functionality