Sample 1 - nested struct
pragma solidity ^0.5.0;
contract C {
struct S {
uint8 v;
}
struct T {
S s;
}
function f() public {
T memory t = T(S(25));
}
}
Actual:
type c_S is record
v : nat;
end;
type c_T is record
s : t_S;
end;
type state is unit;
const c_S_default : c_S = record [ v = 0n ];
const c_T_default : c_T = record [ s = t_S_default ];
function f (const res__unit : unit) : (unit) is
block {
const t : c_T = record [ s = record [ v = 25n ] ];
} with (unit);
Expected:
type c_S is record
v : nat;
end;
type c_T is record
s : c_S;
end;
type state is unit;
const c_S_default : c_S = record [ v = 0n ];
const c_T_default : c_T = record [ s = c_S_default ];
function f (const res__unit : unit) : (unit) is
block {
const t : c_T = record [ s = record [ v = 25n ] ];
} with (unit);
Sample 2 - struct usage before definition
pragma solidity ^0.5.0;
contract C {
function f() public {
S memory s = S(25);
}
struct S {
uint8 v;
}
}
Actual: TypeError: Cannot read property 'scope' of undefined with a full stack trace.
Expected: some sensible Warning.
Sample 1 - nested struct
Actual:
Expected:
Sample 2 - struct usage before definition
Actual:
TypeError: Cannot read property 'scope' of undefinedwith a full stack trace.Expected: some sensible Warning.