Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Func({ node }: NodePath) {
if (node.signature.type !== "Signature") {
throw new RuntimeError(
"Function signatures must be denormalised before execution"
);
}
const signature = (node.signature: Signature);
// Since only one return is allowed at the moment, we don't need to check
// them all.
const resultType = signature.results;
const inferedResultType = getType(node.body);
// Type is unknown, we can not verify the result type
if (typeof inferedResultType === "undefined") {
return;
}