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

Array<T> is exported wrongly as Array, instead of Array[T] #324

Closed
kulkalkul opened this issue Jun 29, 2023 · 8 comments · Fixed by #836
Closed

Array<T> is exported wrongly as Array, instead of Array[T] #324

kulkalkul opened this issue Jun 29, 2023 · 8 comments · Fixed by #836
Labels
bug c: register Register classes, functions and other symbols to GDScript status: upstream Depending on upstream fix (typically Godot)

Comments

@kulkalkul
Copy link
Contributor

Rust:
image
Godot:
image

@lilizoey
Copy link
Member

are you sure it's actually exported wrongly and it's not just the documentation that's wrong?

@kulkalkul
Copy link
Contributor Author

Depends on the meaning of the "export" I guess? It works as it should but no type inference, so I suppose only the type information is wrong. "exported wrongly" might be misnomer in that case

@Bromeon Bromeon added bug c: register Register classes, functions and other symbols to GDScript labels Jun 30, 2023
@lilizoey
Copy link
Member

lilizoey commented Jul 9, 2023

GDScript does the same thing interestingly

class_name Foo extends Node

func my_func(arr: Array[int]) -> Array[int]:
	return arr

image

@lilizoey
Copy link
Member

lilizoey commented Jul 9, 2023

We can fix this by making the PropertyInfo of a type be different between methods/returns and fields. Since if we make the hint PROPERTY_HINT_ARRAY_TYPE with the hint string being the name of the type the array contains, then the docs will properly display Array[type].

But im not sure if this is intended?

@kulkalkul
Copy link
Contributor Author

Hmm, weird why gdscript does that. For example, built-in methods like get_children show the correct signature, Array[Node].

I think it would be better if the type hint also reflects the actual type. I don't know if that's intended or not. I have no serious experience with either gdext or godot. I can only talk about DX in this case 😅

@lilizoey
Copy link
Member

godotengine/godot#79247 seems it's upstream?

@lilizoey lilizoey added the status: upstream Depending on upstream fix (typically Godot) label Jul 12, 2023
@lilizoey
Copy link
Member

should be fixed by godotengine/godot#80745, haven't confirmed yet

@Bromeon
Copy link
Member

Bromeon commented Aug 3, 2024

Even though Godot addressed it upstream, there was another bug on our side, which I now fixed as well 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: register Register classes, functions and other symbols to GDScript status: upstream Depending on upstream fix (typically Godot)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants