contract Option {
data Option[a] = None | Some[a]
function maybe(n, o) {
match o {
| Some[x] => return x;
| _ => return n;
};
}
function main() {
return maybe(7, None);
}
}
yields
function maybe$Word (n : word, o : (unit + word)) -> word {
match o with
{ inl $alt => revert "no match for: None"
inr $alt => { // Some[var_3]
let var_4 : word
var_4 := $alt
return var_4
}
}
the call maybe(7, None) is also mistranslated to Yul (missing padding):
Testcase
test/examples/spec/badmatch.solc
:yields
the call
maybe(7, None)
is also mistranslated to Yul (missing padding):should be sth like
maybe$Word(7, false, $pad1)