From: Matt Corallo Date: Mon, 3 Oct 2022 20:36:31 +0000 (+0000) Subject: Allow trait methods to return NULL-able objects X-Git-Tag: v0.0.111.0^2~8 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-java;a=commitdiff_plain;h=68020b14f0b4f6cf8152a488f9ef3fc27414d232 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. --- 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