I think that I find a bug.

I am a novice in GDScript, then I do not know how to extends a class in this programing language yet. The following steps for the bug is:

1. Create a file called A.gd that contais the class A:

class A:
    func _init():
        pass

2. Save the file A.gd
3. Create a file called B.gd that contais the class B:

class B:
    func _init():
        pass

4. Save this file.
5. Edit the file A.gd like this:

var B = load("res://B.gd")
class A extends B:
    func _init():
        pass

6. Save the file A.gd.

When we save the A.gd, the window close and we can not open the project. The only way to open the project again is editing the A.gd with VSCode or Notepad to erase the "var B = load(...)" line.

It's a strange piece of code but I tried it in 4.0 on windows and indeed it crashes. It can be reproduced in even simpler way:

  • create a new script containing this code:
    var B = 1
    class A extends B:
    	pass
  • try to save the script and the engine crashes to desktop.

Running the console version with verbose and debug flags only outputs this upon the crash:
ERROR: FATAL: Condition "!exists" is true.
at: operator[] (./core/templates/hash_map.h:504)

I reported this issue. Looks like type checking was indeed missing when resolving extends. The pull request was added for 4.1. milestone.

4 days later