From 285119bc1a67c01bd9f37c91fc4dcb17ee72741f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Fri, 26 May 2023 14:10:41 +0200 Subject: [PATCH] GMLCompiler: Force main class name to be resolved from global namespace Calculator would otherwise trip over this, since there's a class with the same name within the namespace. --- Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp b/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp index d2211e7e22..5ac4bc3425 100644 --- a/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/GMLCompiler/main.cpp @@ -123,7 +123,7 @@ static char const function_start[] = R"~~~( // This function was auto-generated by the GML compiler. ErrorOr> @main_class_name@::try_create() { - RefPtr<@main_class_name@> main_object; + RefPtr<::@main_class_name@> main_object; )~~~"; @@ -254,7 +254,7 @@ static ErrorOr generate_loader_for_object(GUI::GML::Object const& gml_obje if (use_object_constructor == UseObjectConstructor::Yes) TRY(append(generator, "@object_name@ = TRY(@class_name@::try_create());")); else - TRY(append(generator, "@object_name@ = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) @class_name@()));")); + TRY(append(generator, "@object_name@ = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ::@class_name@()));")); // Properties TRY(gml_object.try_for_each_property([&](StringView key, NonnullRefPtr value) -> ErrorOr {