-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
GDScript code completion can trigger infinite recursion in _guess_expression_type
#38851
Comments
@razcore-art could you upload a minimal reproduction project or explain the exact steps to reproduce? can't reproduce with this single script var minmax = {"min": 0.0, "max": 1.0}
func _ready():
minmax = {
"min": minmax.min
}
print(minmax) |
Sorry, I had a typo, I think it's related to typed GDScript, can't upload a project cause if I were to type the script out it will freeze my OS. Try this: func _ready() -> void:
var minmax := {"min": 0.0, "max": 1.0}
minmax = {
"min": minmax.min # <- freezes on this line as you type
} |
@ThakeeNathees - there actually seems to be 2 very closely related issues. Open Node2D.gd in codeCompleteBug.zip in the Godot Editor. You will see something like:
You should see a single
The message godot/modules/gdscript/gdscript_editor.cpp Lines 639 to 643 in 24ad489
I'm guessing (1) is an unavoidable issue since in this case the user is trying to redefine "foo" after it has already been declared previously. Not sure how we could ever reliably deal with such cases. In (2), the code seems to enter an infinite loop as well, but checking for I've attached a trace from GDB below:
To replicate:
Next, type "in" in line 13. Then, in GDB, press
Possible Fix Instead of copying
Pass I'm pretty new to this module, so it's just a hypothesis. Do let me know if you have any other possible fix in mind that I can help implement. |
I can confirm this is still reproducible in current In
|
_guess_expression_type
_guess_expression_type
_guess_expression_type
Godot version:
3.2.1.stable.official
OS/device including version:
Ubuntu 20.04
Linux alienware 5.4.0-29-generic #33-Ubuntu SMP Wed Apr 29 14:32:27 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Issue description:
Maximum _guess_expression_type depth limit reached. Please file a bugreport.
Steps to reproduce:
Define a dictionary:
Try to write something like:
Experience total block-out of OS.
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: