solidity/test/libsolidity/semanticTests/constructor/constructor_arguments_internal.sol
2020-07-07 12:16:18 +02:00

41 lines
646 B
Solidity

contract Helper {
bytes3 name;
bool flag;
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;
constructor() {
h = new Helper("abc", true);
}
function getFlag() public returns (bool ret) {
return h.getFlag();
}
function getName() public returns (bytes3 ret) {
return h.getName();
}
}
// ====
// compileViaYul: also
// ----
// getFlag() -> true
// getName() -> "abc"