(context, builder, ty_arg, val)
return result_value
This function should cast value returned from native func back to dicts value_type
This function should cast value returned from native func back to dicts value_type
This function should cast value returned from native func back to dicts value_type
def transform_native_val(context, builder, ty_arg, val):
    """ This function should cast value returned from native func back to dicts value_type """

    if isinstance(ty_arg, types.Number):
        reduced_value_type = reduced_type_map.get(ty_arg, ty_arg)
        result_value = context.cast(builder, val, reduced_value_type, ty_arg)
    else:
        # for values stored as void* in native dict we also need to dereference
        lir_typed_value_ptr = context.get_value_type(ty_arg).as_pointer()
        casted_ptr = builder.bitcast(val, lir_typed_value_ptr)
        result_value = builder.load(casted_ptr)

    return result_value
def transform_native_val ( context , builder , ty_arg , val ) : if isinstance ( ty_arg , types . Number ) : reduced_value_type = reduced_type_map . get ( ty_arg , ty_arg ) result_value = context . cast ( builder , val , reduced_value_type , ty_arg ) else : # for values stored as void* in native dict we also need to dereference lir_typed_value_ptr = context . get_value_type ( ty_arg ) . as_pointer ( ) casted_ptr = builder . bitcast ( val , lir_typed_value_ptr ) result_value = builder . load ( casted_ptr ) return result_value