Skip to content

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

Closed

Description

@Trey2k

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.

Activity

  1. Trey2k commented on Jan 30, 2023

    @Trey2k
    ContributorAuthor

    BTW this was built with a8be6aa

  2. 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[/+] on Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions