'Compiling AggregatorV2V3Interface leads to TypeError: Interfaces cannot inherit. interface

SOlidity course: Brownie Fund Me Lesson 6: https://github.com/PatrickAlphaC/brownie_fund_me

Compiling AggregatorV2V3Interface leads to TypeError: Interfaces cannot inherit. interface I have added a file MockV3Aggregator.sol under contract->test to deploy a mock. However, when I use "brownie compile" I get the following errors:

PS C:\Users\user\Documents\BC\demos\brownie_fund_me> brownie compile
INFO: Could not find files for the given pattern(s).
Brownie v1.18.1 - Python development framework for Ethereum

Compiling contracts...
 Solc version: 0.6.0
 Optimizer: Enabled  Runs: 200
 EVM Version: Istanbul
CompilerError: solc returned the following errors:

C:/Users/user/.brownie/packages/smartcontractkit/chainlink-brownie- 
[email protected]/contracts/src/v0.6/interfaces/AggregatorV2V3Interface.sol:7:38: 
TypeError: Interfaces 
cannot inherit.
interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface
                                 ^-----------------^

C:/Users/user/.brownie/packages/smartcontractkit/chainlink-brownie- 
[email protected]/contracts/src/v0.6/interfaces/AggregatorV2V3Interface.sol:7:59: 
TypeError: Interfaces 
cannot inherit.
interface AggregatorV2V3Interface is AggregatorInterface, AggregatorV3Interface
                                                      ^-------------------^


Solution 1:[1]

Changing the compiler version in VSCode with the solidity plugin via right click "Solidity: change workspace compiler version (Remote)" to 0.6.0 or anything above won't help.

Brownie will ignore this and try to get the highest version in the range of your pragma solidity starting point. pragma solidity >=0.6.0 <0.9.0; The starting point here is 0.6.0 so Brownie will use 0.6.12 and try to compile this file regardless of the settings of VSCode.

Solution: Very simple, change the starting point into something higher and Brownie will use the correct solc.

pragma solidity >=0.8.0 <0.9.0;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";

Not so simple ... This might break your code. So some editing might be in order.

Solution 2:[2]

changing pragma solidity to 0.8.0 instantly compiled the contract.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Washi
Solution 2 Dharman