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

False error "Parse Error: The function signature doesn't match the parent." thrown in larger projects after changing both parent and child. #93347

Closed
robbertzzz opened this issue Jun 19, 2024 · 2 comments

Comments

@robbertzzz
Copy link

robbertzzz commented Jun 19, 2024

Tested versions

Reproduced in both 4.2.1 and 4.2.2

System information

Godot v4.2.2.stable - Windows 10.0.22631 - GLES3 (Compatibility) - AMD Radeon(TM) Graphics (Advanced Micro Devices, Inc.; 31.0.14057.2005) - AMD Ryzen 7 5700U with Radeon Graphics (16 Threads)

Issue description

First off, this bug doesn't seem to be triggered in small projects. I tried to create a MRP, but can't get the bug to trigger there. I've had this happen on multiple bigger projects, which I unfortunately can't share as MRP here.

When having both a parent class and child class, where the child class inherits from the parent class, I keep getting the error "Parse Error: The function signature doesn't match the parent. Parent signature is [...]" after adding/removing a parameter to/from both parent and child functions. Specifically, the editor seems to cache the parent signature and then doesn't update until I reload my or rename the parent class to break the inheritance (wait for the error "class not found" in child) and then renaming it back which seems to clear the cached function signature.

Test case 1 (no error when there should be):
Parent:
image
Child:
image
Notice that the child does have the little override symbol in the padding on the left

Test case 2 (error where there shouldn't be):
Parent:
image
Child:
image

This function started out with a single parameter, following the function signature you see in the error of test case 2. So it's still expecting the original function signature rather than the updated (two parameter) version.

Steps to reproduce

  • Create a function in a parent class, and override it in a child class
  • Add a parameter to the parent function
  • Notice that the child script doesn't throw any errors even though it should
  • Add the same parameter to the child function
  • Notice the error, even though it should be there

Minimal reproduction project (MRP)

N/A, seems to require a large project (all under NDAs) and I don't know the exact cause. If there's anything I can do on my end to help debug this let me know.

@dalexeev
Copy link
Member

Reproduced in both 4.2.1 and 4.2.2

@robbertzzz
Copy link
Author

@dalexeev Just tested it - that did fix it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants