Merge pull request #11211 from ethereum/someTests

Add some bytecode reference tests.
This commit is contained in:
Harikrishnan Mulackal 2021-04-08 09:29:51 +02:00 committed by GitHub
commit c060bd5633
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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".