solidity/test/libsolidity/semanticTests/constructor/constructor_arguments_internal.sol

41 lines
646 B
Solidity
Raw Normal View History

contract Helper {
bytes3 name;
bool flag;
2020-06-23 12:14:24 +00:00
constructor(bytes3 x, bool f) {
name = x;
flag = f;
}
function getName() public returns (bytes3 ret) {
return name;
}
function getFlag() public returns (bool ret) {
return flag;
}
}
contract Main {
Helper h;
2020-06-23 12:14:24 +00:00
constructor() {
h = new Helper("abc", true);
}
function getFlag() public returns (bool ret) {
return h.getFlag();
}
function getName() public returns (bytes3 ret) {
return h.getName();
}
}
2020-05-07 15:29:42 +00:00
// ====
// compileViaYul: also
// ----
// getFlag() -> true
// getName() -> "abc"