1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 09:47:35 +00:00

GMLCompiler: Fully qualify child class names

If we don't do this, and there a class in a namespace with the same
name, type resolution gets confused between `<namespace>::<class>` and
`<class>::<constructor>`.
This commit is contained in:
Tim Schumacher 2023-12-07 01:33:53 +01:00
parent 9deaa74ad6
commit 35d4b36201

View file

@ -312,7 +312,7 @@ static ErrorOr<void> generate_loader_for_object(GUI::GML::Object const& gml_obje
auto child_variable_name = TRY(next_child_name());
child_generator.set("child_variable_name", child_variable_name.bytes_as_string_view());
child_generator.set("child_class_name", child.name());
TRY(append(child_generator, "RefPtr<@child_class_name@> @child_variable_name@;"));
TRY(append(child_generator, "RefPtr<::@child_class_name@> @child_variable_name@;"));
TRY(generate_loader_for_object(child, child_generator.fork(), child_variable_name, indentation + 1, UseObjectConstructor::Yes));
// Handle the current two special cases of child adding.