Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpose broken Array.set_typed #69441

Closed

Conversation

Mickeon
Copy link
Contributor

@Mickeon Mickeon commented Dec 1, 2022

  • This method just does not work, look above.
  • If it were to work, it would only work if the array is empty, is only referenced once, and is not already typed (which cannot be undone).
  • At that point, you may as well either use the Typed Array constructor, or GDScript's static typing syntax.

@akien-mga
Copy link
Member

This seems to be needed for GDExtension to implemented typed arrays:

In file included from /home/runner/work/godot/godot/godot-cpp/gen/include/godot_cpp/classes/object.hpp:42,
                 from /home/runner/work/godot/godot/godot-cpp/include/godot_cpp/classes/ref.hpp:36,
                 from /home/runner/work/godot/godot/godot-cpp/gen/include/godot_cpp/classes/animation_node.hpp:38,
                 from /home/runner/work/godot/godot/godot-cpp/gen/include/godot_cpp/classes/animation_node_time_scale.hpp:36,
                 from /home/runner/work/godot/godot/godot-cpp/gen/src/classes/animation_node_time_scale.cpp:33:
/home/runner/work/godot/godot/godot-cpp/include/godot_cpp/variant/typed_array.hpp: In constructor 'godot::TypedArray<bool>::TypedArray()':
Error: /home/runner/work/godot/godot/godot-cpp/include/godot_cpp/variant/typed_array.hpp:78:4: error: 'set_typed' was not declared in this scope; did you mean 'is_typed'?
   78 |    set_typed(m_variant_type, StringName(), Variant());                              \
      |    ^~~~~~~~~
/home/runner/work/godot/godot/godot-cpp/include/godot_cpp/variant/typed_array.hpp:82:1: note: in expansion of macro 'MAKE_TYPED_ARRAY'
   82 | MAKE_TYPED_ARRAY(bool, Variant::BOOL)
      | ^~~~~~~~~~~~~~~~

CC @bruvzg, ref. #65817.

@akien-mga akien-mga requested a review from bruvzg January 24, 2023 15:42
@akien-mga
Copy link
Member

CC @vonagam @jordigcs - this is core but closely related to your work on typed arrays.

@vonagam
Copy link
Contributor

vonagam commented Jan 24, 2023

If it is required for GDExtension to work then what is the question?

@akien-mga
Copy link
Member

I don't know if it is, waiting for @bruvzg's input on this.

There's no question, it's just an area adjacent to what you're working on on which you may have an opinion. E.g. on whether it is indeed "broken" or whether it can, has or should be fixed.

@bruvzg
Copy link
Member

bruvzg commented Jan 24, 2023

It's not broken, but it is only supposed to be called from the constructor, so it's probably should move to the GDExtensionInterface structure and not exposed to the GDScript (it's not usable from the script).

@YuriSizov
Copy link
Contributor

Superseded by #71989.

@YuriSizov YuriSizov closed this Jan 24, 2023
@Mickeon Mickeon deleted the what-the-heck-is-this-part-3 branch February 11, 2023 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants