Skip to content

Commit

Permalink
Add asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
ericglau committed Oct 8, 2024
1 parent 6b20d76 commit 5882f70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/utils/make-namespaced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ function replaceFunction(
modifications.push(makeReplace(node.body, orig, ';'));
}
} else if (node.body) {
// Otherwise, if there is a body, this may be a library function, free function, or private function.
// Otherwise, as long as the function has a body, we know that it is not overriding any other function and it is not an interface function.
assert(!node.overrides);
assert(contractDef?.contractKind !== 'interface');

// This may be a library function, free function, or private function.
// In any of these cases, we can convert the return parameters to bools so that they can be default initialized.
if (node.returnParameters.parameters.length > 0) {
modifications.push(
Expand Down

0 comments on commit 5882f70

Please sign in to comment.