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

Bug with type hinted RefCounted methods that take a Object* argument #1025

Closed
Trey2k opened this issue Jan 30, 2023 · 1 comment · Fixed by #1044
Closed

Bug with type hinted RefCounted methods that take a Object* argument #1025

Trey2k opened this issue Jan 30, 2023 · 1 comment · Fixed by #1044

Comments

@Trey2k
Copy link
Contributor

Trey2k commented Jan 30, 2023

So I am not sure exactly what is going on here but I ran into a weird bug while working on porting my module. I have a function in my module that is meant to take a pointer to a class type in order to call its new method later. To test I added the following function to the Summator template project.

void Summator::test(Object* test) {
    UtilityFunctions::print(test->has_method("new"));
}

With this method if you run this in GDScript. Everything works fine.

extends Node
var s
class TestClass:
	var a: String

func _ready() -> void:
	s = Summator.new()
	s.test(TestClass)

But if you change var s to var s: Summator instead it will crash.

@Trey2k
Copy link
Contributor Author

Trey2k commented Jan 30, 2023

BTW this was built with a8be6aa

@Trey2k Trey2k changed the title Bug with typed hinted RefCounted methods that take a Object* argument Bug with type hinted RefCounted methods that take a Object* argument Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant