@@ -55,7 +55,12 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
55
55
cloneability_type_message = '; ' .join (cloneability_types )
56
56
print (f'(opaque_struct_generator.py#constructor, warned, deprecated) { cloneability_warning } : { constructor_native_name } [{ cloneability_type_message } ]' )
57
57
58
+
58
59
mutating_output_file_contents = mutating_output_file_contents .replace ('public init' , f'{ deprecation_prefix } public init' )
60
+
61
+ if constructor_prepared_arguments ['has_unwrapped_arrays' ]:
62
+ mutating_output_file_contents = mutating_output_file_contents .replace ('public init(swift_constructor_arguments)' , 'internal init(swift_constructor_arguments)' )
63
+
59
64
mutating_output_file_contents = mutating_output_file_contents .replace ('swift_constructor_arguments' , ', ' .join (constructor_swift_arguments ))
60
65
mutating_output_file_contents = mutating_output_file_contents .replace ('OpaqueStructType(native_constructor_arguments)' , constructor_native_call_prefix + 'OpaqueStructType(' + ', ' .join (
61
66
constructor_native_arguments ) + ')' + constructor_native_call_suffix )
@@ -64,8 +69,6 @@ def generate_opaque_struct(self, struct_name, struct_details, all_type_details={
64
69
mutating_output_file_contents = mutating_output_file_contents .replace ('OpaqueStructType(' , f'{ constructor_native_name } (' )
65
70
66
71
if constructor_prepared_arguments ['has_unwrapped_arrays' ]:
67
- # only replace the default init, don't replace the others
68
- mutating_output_file_contents = mutating_output_file_contents .replace ('public init' , f'internal init' , 1 )
69
72
70
73
prepared_arguments = ConversionHelper .prepare_swift_to_native_arguments (constructor_details ['argument_types' ], array_unwrapping_preparation_only = True )
71
74
current_addition = method_template
0 commit comments