Modify ModuleBuilder::declare_function
to Return Error on Conflicting Declarations
#91
Labels
ModuleBuilder::declare_function
to Return Error on Conflicting Declarations
#91
Currently, the
ModuleBuilder::declare_function
method updates the existing function declaration when a function with the same name is declared again. This behavior can unintentionally overwrite previous declarations, potentially leading to inconsistencies or unexpected behaviors in the module.We propose changing this behavior so that
declare_function
returns aResult
. If a function with the same name is already registered and its signature differs from the new declaration, the method should return an error instead of updating the existing declaration.Proposed Changes:
Add
BuilderError
typeModify Return Type:
ModuleBuilder::declare_function
to return aResult<Function, BuilderError>
Conflict Detection:
The text was updated successfully, but these errors were encountered: