Describe the bug
Overloaded function renaming might cause conflicts
To Reproduce
See #1317
I have a class:
class Image {
public:
static uint64_t byteSwap(uint64_t value, bool bSwap);
static uint32_t byteSwap(uint32_t value, bool bSwap);
static uint16_t byteSwap(uint16_t value, bool bSwap);
static uint16_t byteSwap2(const DataBuf& buf, size_t offset, bool bSwap);
};
calling generate! on it will cause byteSwap2 to be generated twice. One for the overload, one for the actual byteSwap2.
pub unsafe fn byteSwap(value: u64, bSwap: bool) -> u64 { }
pub unsafe fn byteSwap1(value: u32, bSwap: bool) -> u32 { }
pub unsafe fn byteSwap2(value: u16, bSwap: bool) -> u16 { }
pub unsafe fn byteSwap2(buf: &root::Exiv2::DataBuf,
offset: usize,
bSwap: bool,
) -> u16 {}
This is because the renaming of the return u16 overload is byteSwap2 and there is an actual byteSwap2 function.
Expected behavior
Find a better renaming.
Or throw an error from the macro
Additional context
Describe the bug
Overloaded function renaming might cause conflicts
To Reproduce
See #1317
I have a class:
calling
generate!on it will causebyteSwap2to be generated twice. One for the overload, one for the actualbyteSwap2.This is because the renaming of the return u16 overload is
byteSwap2and there is an actualbyteSwap2function.Expected behavior
Find a better renaming.
Or throw an error from the macro
Additional context