Add some bytecode reference tests.

This commit is contained in:
chriseth 2021-04-06 16:25:02 +02:00
parent 5433a640fb
commit 47728a083f
4 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,11 @@
library L1 {
function foo() internal { new A(); }
}
library L2 {
function foo() internal { L1.foo(); }
}
contract A {
function f() public pure { L2.foo(); }
}
// ----
// TypeError 7813: (43-48): Circular reference to contract bytecode either via "new" or "type(...).creationCode" / "type(...).runtimeCode".

View File

@ -0,0 +1,11 @@
library L1 {
function foo() internal { new A(); }
}
library L2 {
function foo() internal { L1.foo(); }
}
contract A {
function f() public pure { type(L2).creationCode; }
}
// ----
// Warning 6133: (157-178): Statement has no effect.

View File

@ -0,0 +1,10 @@
library L1 {
function foo() internal { new A(); }
}
library L2 {
function foo() public { L1.foo(); }
}
contract A {
function f() public { L2.foo(); }
}
// ----

View File

@ -0,0 +1,9 @@
library L1 {
function foo() public { L2.foo(); }
}
library L2 {
function foo() internal { type(L1).creationCode; }
}
// ----
// TypeError 7813: (99-120): Circular reference to contract bytecode either via "new" or "type(...).creationCode" / "type(...).runtimeCode".