I have a contract Example, which imports another contract Another. When I try to import the contract and declare it in the code like this:

import './Another.sol'

contract Example {

    Another Another;


I get the above type error. The contract definitely exists, and I've done this pattern before, why am I getting this type error?

1 Answer 1


The variable name cannot be the same as the contract name. So the instance of Another cannot be named Another, you must call it another, or something else, like anotherInstance. Annoying problem that I ran into that wasn't documented, so I decided to put this up.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.