hardhat-vscode
hardhat-vscode copied to clipboard
Implement interface edge case
trafficstars
To reproduce:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
interface IExample {
function another() external pure;
function another2() external pure;
}
abstract contract Example {
constructor() {}
function another() external pure virtual;
}
contract Extender is IExample, Example {
constructor() {}
function another() external pure override(Example, IExample) {}
// function another2() external pure override {}
}
This creates a error with our implement interfaces quickfix. The result has an additional function:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
interface IExample {
function another() external pure;
function another2() external pure;
}
abstract contract Example {
constructor() {}
function another() external pure virtual;
}
contract Extender is IExample, Example {
constructor() {}
function another() external pure override(Example, IExample) {}
function another() external pure override(Example, IExample) {}
function another2() external pure override {}
}
The comparison logic to see if the function is already implemented needs to be looked at.