hyperledger / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.22k stars 207 forks source link

Incorrect metadata for overridden functions. #1623

Closed TorstenStueber closed 4 months ago

TorstenStueber commented 4 months ago

Describe the bug Whenever a method is overriden, Solang appends an underscore _ to the method name in the generated metadata file.

To Reproduce After compiling the following file:

abstract contract Base {
    function test() public pure virtual returns (uint8) {
        return 42;
    }
}

contract TestA is Base {

}

contract TestB is Base {
    function test() public pure override returns (uint8) {
        return 42;
    }
} 

with Solang (latest release 0.3.3), the generated metadata file for TestA correctly calls the method test ("label": "test").

However, in contract TestB it is called test_ ("label": "test_").

Expected behavior The metadata name is also test in the metadata for contract TestB.

This is also the behavior of the Solidity compiler (where the method is called test in both cases in the generated metadata).

Hyperledger Solang version 0.3.3

xermicus commented 4 months ago

@TorstenStueber thank you for reporting this to us. The bug should be fixed in #1624.