Merge pull request #11914 from ethereum/userdefined-move-test

User defined value types: moved a syntax test to semantic test.
This commit is contained in:
chriseth 2021-09-09 14:19:32 +02:00 committed by GitHub
commit 5de276cb75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View File

@ -0,0 +1,13 @@
type MyInt is int;
contract C {
function f() public returns (MyInt a, int b) {
(MyInt).wrap;
a = (MyInt).wrap(5);
(MyInt).unwrap;
b = (MyInt).unwrap((MyInt).wrap(10));
}
}
// ====
// compileViaYul: also
// ----
// f() -> 5, 10

View File

@ -1,7 +0,0 @@
type MyInt is int;
function f() pure {
(MyInt).wrap;
(MyInt).wrap(5);
(MyInt).unwrap;
(MyInt).unwrap(MyInt.wrap(5));
}