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

Parse error when typing dictionary with custom class forvalues, and calling method on the value #98903

Closed
Nexusbeeyst opened this issue Nov 6, 2024 · 2 comments

Comments

@Nexusbeeyst
Copy link

Nexusbeeyst commented Nov 6, 2024

Tested versions

4.4dev3, 4.4dev2

System information

Godot v4.4.dev3 - Windows 10.0.22631 - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 32.0.15.6094) - AMD Ryzen 7 5800X 8-Core Processor (16 threads)

Issue description

Parse error when attempting to call a method on a dictionary value from a different class, when the value is of a custom class type.

eg: (where component inherits node2d with no other modifications)

/// entity.gd
class_name Entity
extends Node2D

var components: Dictionary[int, Component] = {
	1: null,
}

/// other_node.gd
class_name OtherNode
extends Node2D

func component_method(entity: Entity) -> void:
	entity.components[1].free()
Error at (5,5)
Parser bug(please report): Could not find external parser for class "Component". (Trying to resolve class inheritance)

Steps to reproduce

Create custom class A, in class B, make a typed dictionary where the values are of A, then in class C, attempt to call any method on an accessed dictionary value.

Minimal reproduction project (MRP)

4.4dev3mrp.zip

@dalexeev
Copy link
Member

dalexeev commented Nov 6, 2024

@Nexusbeeyst
Copy link
Author

Fix worked.

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

No branches or pull requests

3 participants