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

Fix constructor with generic args registration #396

Merged

Conversation

chippmann
Copy link
Contributor

The registration of constructors which have generic type parameters like Dictionary was broken.

The following class:

@RegisterClass
class ConstructorRegistrationTest(): Node() {
    @RegisterConstructor
    constructor(param1: Dictionary<Any, Any?>, param2: VariantArray<Long>): this()
}

produced the following invalid constructor registration:

constructor(KtConstructor2({param1: Dictionary<AnyAny?>, param2: VariantArray<Long> -> ConstructorRegistrationTest(param1, param2)}, DICTIONARY to false, ARRAY to false))

The reason was that i forgot to add , for generic type parameters while assembling the kotlin poet template for the constructor registration. This PR fixes this.

@chippmann chippmann added bug Something isn't working topic:entry-gen labels Dec 2, 2022
@chippmann chippmann merged commit 6384dc4 into master Dec 6, 2022
@chippmann chippmann deleted the bugfix/fix_constructor_with_multiple_args_registration branch December 6, 2022 06:23
chippmann added a commit that referenced this pull request Mar 24, 2023
* Fix registration of constructors with multiple args

* Add test class

(cherry picked from commit 6384dc4)
chippmann added a commit that referenced this pull request Mar 25, 2023
* Fix typo in your-first-class doc (#378)

* Generate `.gdignore` files for the `build` and the `gradle` directories (#366)

* Add task to generate `.gdignore` files for the `build` and the `gradle` directories

* Improve task setup and add jre folders to ignored folders

* Implement generics check (#375)

This check verifies that the user does not try to register any generic types as these won't compile

* enh: Move jvm types registration code from GDKotlin to TypeManager (#357)

* Export android x86_64 target (#381)

* Export android x86_64 target

* Fix path for debug builds

(cherry picked from commit b57ab94)

# Conflicts:
#	.github/actions/create-android-export-template/action.yaml
#	.github/workflows/check-pr-engine-export-template-debug.yaml
#	.github/workflows/check-pr-engine-export-template-release.yaml
#	.github/workflows/deploy-export-template.yaml

* Improve changelog header to be more explict about which files are for what (#392)

(cherry picked from commit c741582)

* Fix constructor with generic args registration (#396)

* Fix registration of constructors with multiple args

* Add test class

(cherry picked from commit 6384dc4)

* Fix reflection usage in usercode (#452)

* Add `kotlin-reflect` dependency to godot-library

* Temporarily fix scons version

* Add graal reflection configuration file option and update comment on existing option

* Add additional graal options needed for reflection to work and also commit the standard configuration for kotlin-reflection

(cherry picked from commit c273de5)

---------

Co-authored-by: Cristian Heitt <[email protected]>
Co-authored-by: Pierre-Thomas Meisels <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic:entry-gen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants