From c9a4086da633fa0112d04335a3f3598e9bd2021d Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Tue, 5 Dec 2023 08:34:22 -0600 Subject: [PATCH] Fix EncodeT assignment in make_virtuals.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Adding EncodeT type casting allows generated code to support enum classes. --- core/object/make_virtuals.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py index 88d556ef82b..ae70981f72c 100644 --- a/core/object/make_virtuals.py +++ b/core/object/make_virtuals.py @@ -121,7 +121,9 @@ def generate_version(argcount, const=False, returns=False): callargtext += f"m_type{i + 1} arg{i + 1}" callsiargs += f"Variant(arg{i + 1})" callsiargptrs += f"&vargs[{i}]" - callptrargs += f"PtrToArg::EncodeT argval{i + 1} = arg{i + 1};\\\n" + callptrargs += ( + f"PtrToArg::EncodeT argval{i + 1} = (PtrToArg::EncodeT)arg{i + 1};\\\n" + ) callptrargsptr += f"&argval{i + 1}" if method_info: method_info += "\\\n\t\t"