Skip to content

Overridden function's base function is also available in the contract #1975

Open
@Tiko7454

Description

@Tiko7454

Describe the issue:

When a function is overridden in the contract B, the contract B contains two functions with identical signatures but one of that functions are not accessible from an object of type B

Code example to reproduce the issue:

abstract contract A {
	function f() virtual public returns(uint);
}

contract B is A {
	function f() public override returns(uint) {
		return 2;
	}
}

Version:

0.9.3

Relevant log output:

>>> from slither import Slither
>>> B = Slither('override.sol').contracts[1]
>>> B.functions_signatures
['f()']
>>> B.functions
[<slither.core.declarations.function_contract.FunctionContract object at 0x7fd18b823940>, <slither.core.declarations.function_contract.FunctionContract object at 0x7fd18b88e050>]
>>> B.functions[0].contract == B
True
>>> B.functions[1].contract == B
True
>>> B.functions[0].signature == B.functions[1].signature
True

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions