Detect circular references for library and free functions

This commit is contained in:
Mathias Baumann
2021-03-30 23:06:30 +02:00
committed by chriseth
parent 15fe07bebe
commit e590a99f39
37 changed files with 1168 additions and 288 deletions
@@ -0,0 +1,18 @@
// Checks that error is triggered no matter which order
function l() {
s();
}
function s() {
new C();
}
contract D {
function f() public {
l();
}
}
contract C {
constructor() { new D(); }
}
// ----
// TypeError 7813: (98-103): Circular reference to contract bytecode either via "new" or "type(...).creationCode" / "type(...).runtimeCode".
// TypeError 7813: (187-192): Circular reference to contract bytecode either via "new" or "type(...).creationCode" / "type(...).runtimeCode".