From 68020b14f0b4f6cf8152a488f9ef3fc27414d232 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 3 Oct 2022 20:36:31 +0000 Subject: [PATCH] Allow trait methods to return NULL-able objects The comment claiming this isn't supported in Java/TS is incorrect - it works just fine with no further modifications. --- genbindings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/genbindings.py b/genbindings.py index 1ade1705..fd09ba2a 100755 --- a/genbindings.py +++ b/genbindings.py @@ -756,9 +756,8 @@ with open(sys.argv[1]) as in_h, open(f"{sys.argv[2]}/bindings{consts.file_ext}", else: (nullable_params, ret_nullable) = doc_to_params_ret_nullable(fn_docs) if ret_nullable: - assert False # This isn't yet handled on the Java side - ret_ty_info.nullable = True ret_ty_info = type_mapping_generator.map_nullable_type(fn_line.group(2).strip() + " ret", True, None, False, False) + ret_ty_info.nullable = True else: ret_ty_info = type_mapping_generator.map_type(fn_line.group(2).strip() + " ret", True, None, False, False) is_const = fn_line.group(4) is not None -- 2.39.5