question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Let compiler handle cyclic dependencies

See original GitHub issue

If I have two contracts like so

import "./pong.sol"
contract ping
{
    pong p;
}

and

import "./ping.sol"
contract pong
{
    ping p;
}

I get a cyclic dependency error when compiling. I was under the impression this shouldn’t happen as they only have each other as members in the contracts, not inherit from each other.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
tcoultercommented, Mar 20, 2017

This has been fixed in truffle-compile, v1.1.1. You should be able to get this update if you uninstall and reinstall Truffle, if on Truffle 3.x. Thanks for the reports!

2reactions
D-Nicecommented, Mar 6, 2017

Ran into same issue, and hopefully looking to have solc handle this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve build errors due to circular dependency amongst ...
The reason this fix is bad is because the next person to #include "A.h" will have to declare B before they can use...
Read more >
Circular Dependencies in C++ - pvigier's blog
Its goal is to draw the “include” dependencies between classes in a C++ project. In particular, it allows to detect circular dependencies ......
Read more >
Compiler Linking: How to handle circular references?
I'm currently writing a compiler for a new language and I'm struggling with the linking aspect of new Types when there exists a...
Read more >
Do we really need circular dependencies in a C compiler ...
Simple circular inclusion of files won't work in any C compiler. The problem to solve is exactly the same as recursivity inclusion needs...
Read more >
Cyclic dependencies are evil · F# for Fun and Profit - swlaschin
Cyclic dependencies : Part 1. ... The F# compiler should handle all type resolution matters automatically, independent of ... Let's start with detection....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found