You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
machulen
changed the title
Structs are being translated wrongly in some cases
Structs are being mistranslated in some cases
Oct 1, 2020
Sample 1 - nested struct
Actual:
Expected:
Sample 2 - struct usage before definition
Actual:
TypeError: Cannot read property 'scope' of undefined
with a full stack trace.Expected: some sensible Warning.
The text was updated successfully, but these errors were encountered: