Skip to content

Typed dictionary initializer support #1750

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

Merged

Conversation

tomfull123
Copy link
Contributor

@tomfull123 tomfull123 commented Mar 24, 2025

Allows for the following syntax:

TypedDictionary<int, String> colors = {
	{1, "Red"},
	{2, "Green"}
};

@tomfull123 tomfull123 requested a review from a team as a code owner March 24, 2025 19:47
Copy link
Collaborator

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This looks just like the equivalent code in Godot, so I'd be inclined to approve it, but there is one difference that I'd like to clear up first

@dsnopek
Copy link
Collaborator

dsnopek commented Apr 1, 2025

I'll bringing up the missing TypedDictionary constructor at today's GDExtension team meeting if Repiteo is there, otherwise I'll ask about it at tomorrow's core team meeting.

Also, like I mentioned on another of your PRs, before this can be merged it needs to get squashed down to a single commit: https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html#the-interactive-rebase

@tomfull123 tomfull123 force-pushed the typed-dictionary-initializer-support branch from 2efb83a to 4ffea9e Compare April 1, 2025 19:56
Copy link
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slated for merge on the main repo & this implementation mirrors that nicely

EDIT: Now merged on the main repo!

@tomfull123 tomfull123 force-pushed the typed-dictionary-initializer-support branch from 4ffea9e to 335b490 Compare April 3, 2025 22:16
@tomfull123
Copy link
Contributor Author

tomfull123 commented Apr 3, 2025

Updated PR to add in changes from godotengine/godot#104664
Unfortunately that includes updating the macro backslashes, which results in a bigger diff

Copy link
Collaborator

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dsnopek dsnopek merged commit 1163d1b into godotengine:master Apr 5, 2025
11 checks passed
@tomfull123 tomfull123 deleted the typed-dictionary-initializer-support branch April 7, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.4 enhancement This is an enhancement on the current functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants